2014-07-22 22:42:48 +00:00
|
|
|
<?php
|
2016-02-12 16:57:37 +00:00
|
|
|
|
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() {
|
|
|
|
define( 'RANDOM_ID', 'a_random_id' );
|
2021-07-30 19:17:20 +00:00
|
|
|
$renderer = $this->getServiceContainer()
|
|
|
|
->get( 'Math.RendererFactory' )
|
|
|
|
->getRenderer( "a+b", [ 'id' => RANDOM_ID ] );
|
2017-07-10 09:40:12 +00:00
|
|
|
$this->assertEquals( RANDOM_ID, $renderer->getID() );
|
2014-07-22 22:42:48 +00:00
|
|
|
}
|
|
|
|
|
2015-01-10 01:55:54 +00:00
|
|
|
}
|