mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-15 11:48:23 +00:00
6889086753
The integration tests depend on the presence of external servers and the user settings. First, people are bothered by failing test due to problems with those servers and second, administrators need to run phpunit tests to verify the configuration settings. Therefore, we move the integration tests to a special page. Bug: T87389 Change-Id: If66f13fe7fa16868cd4b1d8f0e0a6e3d49448b27
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'
|
|
);
|
|
}
|
|
}
|