mediawiki-extensions-Math/tests/phpunit/MathLaTeXMLTest.php
Thiemo Kreuz 5648b8e2c3 Make use of the …::class feature whenever possible
Note that a class is not resolved this was. …::class is not a function
call. It's more like a named string constant. Technically still a
string. The advantage is that IDEs and tools like linters can much easier
understand that these strings refer to a class, and list them in usage
reports, renames, and such.

Change-Id: I5225543dbb837685a1840837cb2772dd576cca38
2018-06-06 12:13:04 +02:00

43 lines
911 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'
);
}
}