mediawiki-extensions-Math/tests/phpunit/MathLaTeXMLTest.php
Thiemo Kreuz b189280467 Make all @covers tags absolute, and fix some
Some mentioned a "__constructor", which should be "__construct".

The leading backslash is not strictly needed by all tools. But some
need it. I learned it's best practice to always have it.

Change-Id: I22fe3a3b4828c02ab5a457aba9af5af1c72567ea
2019-11-26 11:01:23 +01:00

43 lines
913 B
PHP

<?php
/**
* Test the LaTeXML output format.
*
* @covers \MathLaTeXML
*
* @group Math
*
* @license GPL-2.0-or-later
*/
class MathLaTeXMLTest extends MediaWikiTestCase {
/**
* Tests the serialization of the LaTeXML settings
* @covers \MathLaTeXML::serializeSettings
*/
public function testSerializeSettings() {
$renderer = $this->getMockBuilder( MathLaTeXML::class )
->setMethods( null )
->disableOriginalConstructor()
->getMock();
$sampleSettings = [
'k1' => 'v1',
'k2&=' => 'v2 + & *üö',
'k3' => [
'v3A', 'v3b'
]
];
$expected = 'k1=v1&k2%26%3D=v2+%2B+%26+%2A%C3%BC%C3%B6&k3=v3A&k3=v3b';
$this->assertEquals(
$expected,
$renderer->serializeSettings( $sampleSettings ),
'test serialization of array settings'
);
$this->assertEquals(
$expected,
$renderer->serializeSettings( $expected ),
'test serialization of a string setting'
);
}
}