mediawiki-extensions-Math/tests/phpunit/MathLaTeXMLTest.php
Moritz Schubotz (physikerwelt) 88546ae1ad
Move phpunit test files
* currently the phpunit tests are not triggered by jenkins
* some test can't be re-enabled possible reasons:
** the texvc and texvccheck binaries are not available from jenkins
** the binaries can not be generated
** the path to the binaries are not set up correctly

Bug: T142120
Change-Id: I0c8fe5ad652c4663eeb029781521acbf56e42bad
2018-04-22 10:09:12 +02:00

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