diff --git a/src/SpecialMathStatus.php b/src/SpecialMathStatus.php index be346da1d..bd73a1b6f 100644 --- a/src/SpecialMathStatus.php +++ b/src/SpecialMathStatus.php @@ -74,7 +74,9 @@ class SpecialMathStatus extends SpecialPage { private function runNativeTest( $modeName ) { $this->getOutput()->addWikiMsgArray( 'math-test-start', [ $modeName ] ); $renderer = $this->rendererFactory->getRenderer( "a+b", [], MathConfig::MODE_NATIVE_MML ); - $this->assertTrue( $renderer->render(), "Rendering of a+b in $modeName" ); + if ( !$this->assertTrue( $renderer->render(), "Rendering of a+b in $modeName" ) ) { + return; + } $real = str_replace( "\n", '', $renderer->getHtmlOutput() ); $expected = '+'; $this->assertContains( $expected, $real, "Checking the presence of '+' in the MathML output" ); @@ -99,7 +101,9 @@ class SpecialMathStatus extends SpecialPage { public function testSpecialCaseText() { $renderer = $this->rendererFactory->getRenderer( 'x^2+\text{a sample Text}', [], MathConfig::MODE_MATHML ); $expected = 'a sample Text'; - $this->assertTrue( $renderer->render(), 'Rendering the input "x^2+\text{a sample Text}"' ); + if ( !$this->assertTrue( $renderer->render(), 'Rendering the input "x^2+\text{a sample Text}"' ) ) { + return; + } $this->assertContains( $expected, $renderer->getHtmlOutput(), 'Comparing to the reference rendering' ); @@ -111,7 +115,9 @@ class SpecialMathStatus extends SpecialPage { */ public function testMathMLIntegration() { $renderer = $this->rendererFactory->getRenderer( "a+b", [], MathConfig::MODE_MATHML ); - $this->assertTrue( $renderer->render(), "Rendering of a+b in plain MathML mode" ); + if ( !$this->assertTrue( $renderer->render(), "Rendering of a+b in plain MathML mode" ) ) { + return; + } $real = str_replace( "\n", '', $renderer->getHtmlOutput() ); $expected = '+'; $this->assertContains( $expected, $real, "Checking the presence of '+' in the MathML output" ); @@ -135,7 +141,9 @@ class SpecialMathStatus extends SpecialPage { $attribs = [ 'type' => 'pmml' ]; $renderer = $this->rendererFactory->getRenderer( $inputSample, $attribs, MathConfig::MODE_MATHML ); $this->assertEquals( 'pmml', $renderer->getInputType(), 'Checking if MathML input is supported' ); - $this->assertTrue( $renderer->render(), 'Rendering Presentation MathML sample' ); + if ( !$this->assertTrue( $renderer->render(), 'Rendering Presentation MathML sample' ) ) { + return; + } $real = $renderer->getHtmlOutput(); $this->assertContains( 'mode=mathml', $real, 'Checking if the link to SVG image is in correct mode' ); } @@ -146,7 +154,9 @@ class SpecialMathStatus extends SpecialPage { */ public function testLaTeXMLIntegration() { $renderer = $this->rendererFactory->getRenderer( "a+b", [], MathConfig::MODE_LATEXML ); - $this->assertTrue( $renderer->render(), "Rendering of a+b in LaTeXML mode" ); + if ( !$this->assertTrue( $renderer->render(), "Rendering of a+b in LaTeXML mode" ) ) { + return; + } // phpcs:ignore Generic.Files.LineLength.TooLong $expected = 'getHtmlOutput() ); @@ -170,7 +180,9 @@ class SpecialMathStatus extends SpecialPage { $tex .= $testMax; $renderer = new MathLaTeXML( $tex, [ 'display' => 'linebreak' ] ); $renderer->setPurge(); - $this->assertTrue( $renderer->render(), "Rendering of linebreak test in LaTeXML mode" ); + if ( !$this->assertTrue( $renderer->render(), "Rendering of linebreak test in LaTeXML mode" ) ) { + return; + } $expected = 'mtr'; $real = preg_replace( "/\n\\s*/", '', $renderer->getHtmlOutput() ); $this->assertContains( $expected, $real, "Checking for linebreak" .