| 1 | <?php |
| 2 | |
| 3 | use MediaWiki\Extension\Math\MathConfig; |
| 4 | |
| 5 | /** |
| 6 | * Test the Id feature |
| 7 | * |
| 8 | * @covers \MediaWiki\Extension\Math\MathRenderer |
| 9 | * |
| 10 | * @group Math |
| 11 | * |
| 12 | * @license GPL-2.0-or-later |
| 13 | */ |
| 14 | class MathIdTest extends MediaWikiIntegrationTestCase { |
| 15 | |
| 16 | /** |
| 17 | * Checks if the id specified as attribute is set in the renderer object |
| 18 | */ |
| 19 | public function testBasics() { |
| 20 | $randomId = 'a_random_id'; |
| 21 | $renderer = $this->getServiceContainer() |
| 22 | ->get( 'Math.RendererFactory' ) |
| 23 | ->getRenderer( "a+b", [ 'id' => $randomId ], MathConfig::MODE_MATHML ); |
| 24 | $this->assertEquals( $randomId, $renderer->getID() ); |
| 25 | } |
| 26 | |
| 27 | } |