diff --git a/images/reference-nospeech.svg b/images/reference-nospeech.svg deleted file mode 100644 index d9e743beb..000000000 --- a/images/reference-nospeech.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/images/reference.svg b/images/reference.svg deleted file mode 100644 index 36ebe87dc..000000000 --- a/images/reference.svg +++ /dev/null @@ -1,14 +0,0 @@ - - Equation - a plus b - - - \ No newline at end of file diff --git a/src/SpecialMathStatus.php b/src/SpecialMathStatus.php index 3e411deab..78458c4e0 100644 --- a/src/SpecialMathStatus.php +++ b/src/SpecialMathStatus.php @@ -110,15 +110,15 @@ class SpecialMathStatus extends SpecialPage { * i.e. if the span element is generated right. */ public function testMathMLIntegration() { - $svgRef = file_get_contents( __DIR__ . '/../images/reference.svg' ); - $svgRefNoSpeech = file_get_contents( __DIR__ . '/../images/reference-nospeech.svg' ); $renderer = $this->rendererFactory->getRenderer( "a+b", [], MathConfig::MODE_MATHML ); $this->assertTrue( $renderer->render(), "Rendering of a+b in plain MathML mode" ); $real = str_replace( "\n", '', $renderer->getHtmlOutput() ); $expected = '+'; $this->assertContains( $expected, $real, "Checking the presence of '+' in the MathML output" ); - $this->assertEquals( [ $svgRef, $svgRefNoSpeech ], $renderer->getSvg(), - "Comparing the generated SVG with the reference" + $this->assertContains( + 'getSvg(), + "Check that the generated SVG image contains the xlink namespace" ); } @@ -137,8 +137,11 @@ class SpecialMathStatus extends SpecialPage { $this->assertEquals( 'pmml', $renderer->getInputType(), 'Checking if MathML input is supported' ); $this->assertTrue( $renderer->render(), 'Rendering Presentation MathML sample' ); $real = $renderer->getHtmlOutput(); - $expected = 'hash=5628b8248b79267ecac656102334d5e3&mode=mathml'; - $this->assertContains( $expected, $real, 'Checking if the link to SVG image is correct' ); + $this->assertContains( + 'Special:MathShowImage', + $real, + 'Checking if the link to SVG image uses a special page' ); + $this->assertContains( 'mode=mathml', $real, 'Checking if the link to SVG image is in correct mode' ); } /** @@ -149,7 +152,7 @@ class SpecialMathStatus extends SpecialPage { $renderer = $this->rendererFactory->getRenderer( "a+b", [], MathConfig::MODE_LATEXML ); $this->assertTrue( $renderer->render(), "Rendering of a+b in LaTeXML mode" ); // phpcs:ignore Generic.Files.LineLength.TooLong - $expected = 'a+bab{\displaystyle a+b}'; + $expected = 'getHtmlOutput() ); $this->assertContains( $expected, $real, "Comparing the output to the MathML reference rendering" .