mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-12-01 02:36:47 +00:00
df8ad1c799
Add support for php code sniffer Change-Id: I7dcdd88be4f1f8219f71ab770979284761e09bae
37 lines
851 B
PHP
37 lines
851 B
PHP
<?php
|
|
/**
|
|
* Test the LaTeXML output format.
|
|
*
|
|
* @group Math
|
|
*/
|
|
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 = array(
|
|
'k1' => 'v1',
|
|
'k2&=' => 'v2 + & *üö',
|
|
'k3' => array(
|
|
'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'
|
|
);
|
|
}
|
|
}
|