Debian Codegraph @

extensions/Math/tests/phpunit/MathLaTeXMLTest.php

raw symbols SCIP
1 <?php
2
3 use MediaWiki\Extension\Math\MathLaTeXML;
4
5 /**
6 * Test the LaTeXML output format.
7 *
8 * @covers \MediaWiki\Extension\Math\MathLaTeXML
9 *
10 * @group Math
11 *
12 * @license GPL-2.0-or-later
13 */
14 class MathLaTeXMLTest extends MediaWikiIntegrationTestCase {
15
16 /**
17 * Tests the serialization of the LaTeXML settings
18 * @covers \MediaWiki\Extension\Math\MathLaTeXML::serializeSettings
19 */
20 public function testSerializeSettings() {
21 $renderer = new MathLaTeXML();
22 $sampleSettings = [
23 'k1' => 'v1',
24 'k2&=' => 'v2 + & *üö',
25 'k3' => [
26 'v3A', 'v3b'
27 ]
28 ];
29 $expected = 'k1=v1&k2%26%3D=v2+%2B+%26+%2A%C3%BC%C3%B6&k3=v3A&k3=v3b';
30 $this->assertEquals(
31 $expected,
32 $renderer->serializeSettings( $sampleSettings ),
33 'test serialization of array settings'
34 );
35 $this->assertEquals(
36 $expected,
37 $renderer->serializeSettings( $expected ),
38 'test serialization of a string setting'
39 );
40 }
41 }