diff --git a/MathRenderer.php b/MathRenderer.php index 0a99a5e..1fe7ba7 100644 --- a/MathRenderer.php +++ b/MathRenderer.php @@ -572,7 +572,7 @@ abstract class MathRenderer { return true; } } - $checker = new MathInputCheckTexvc( $this->userInputTex ); + $checker = new MathInputCheckRestbase( $this->userInputTex ); if ( $checker->isValid() ) { $this->setTex( $checker->getValidTex() ); $this->texSecure = true; diff --git a/tests/MathRendererTest.php b/tests/MathRendererTest.php index 1ac899d..4ab6e68 100644 --- a/tests/MathRendererTest.php +++ b/tests/MathRendererTest.php @@ -8,6 +8,25 @@ class MathRendererTest extends MediaWikiTestCase { const SOME_TEX = "a+b"; const TEXVCCHECK_INPUT = '\forall \epsilon \exist \delta'; const TEXVCCHECK_OUTPUT = '\forall \epsilon \exists \delta '; // be aware of the s at exists + + protected static $hasRestbase; + + public static function setUpBeforeClass() { + $rbi = new MathRestbaseInterface(); + self::$hasRestbase = $rbi->checkBackend( true ); + } + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() { + parent::setUp(); + if ( !self::$hasRestbase ) { + $this->markTestSkipped( "Can not connect to Restbase Math interface." ); + } + } + /** * Checks the tex and hash functions * @covers MathRenderer::getTex()