2014-07-22 22:42:48 +00:00
|
|
|
<?php
|
2016-02-12 16:57:37 +00:00
|
|
|
|
2021-08-11 18:15:35 +00:00
|
|
|
use MediaWiki\Extension\Math\MathConfig;
|
|
|
|
|
2014-07-22 22:42:48 +00:00
|
|
|
/**
|
|
|
|
* Test the Id feature
|
2016-02-12 16:57:37 +00:00
|
|
|
*
|
2021-04-07 22:22:05 +00:00
|
|
|
* @covers \MediaWiki\Extension\Math\MathRenderer
|
2016-02-12 16:57:37 +00:00
|
|
|
*
|
2014-07-22 22:42:48 +00:00
|
|
|
* @group Math
|
2016-02-12 16:57:37 +00:00
|
|
|
*
|
2018-04-13 14:06:39 +00:00
|
|
|
* @license GPL-2.0-or-later
|
2014-07-22 22:42:48 +00:00
|
|
|
*/
|
2021-07-30 19:17:20 +00:00
|
|
|
class MathIdTest extends MediaWikiIntegrationTestCase {
|
2014-07-22 22:42:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if the id specified as attribute is set in the renderer object
|
|
|
|
*/
|
|
|
|
public function testBasics() {
|
2021-08-11 18:15:35 +00:00
|
|
|
$randomId = 'a_random_id';
|
2021-07-30 19:17:20 +00:00
|
|
|
$renderer = $this->getServiceContainer()
|
|
|
|
->get( 'Math.RendererFactory' )
|
2022-11-18 22:50:15 +00:00
|
|
|
->getRenderer( "a+b", [ 'id' => $randomId ], MathConfig::MODE_MATHML );
|
2021-08-11 18:15:35 +00:00
|
|
|
$this->assertEquals( $randomId, $renderer->getID() );
|
2014-07-22 22:42:48 +00:00
|
|
|
}
|
|
|
|
|
2015-01-10 01:55:54 +00:00
|
|
|
}
|