mediawiki-extensions-Math/tests/phpunit/MathIdTest.php
Petr Pchelko 9b7205599c Move math configuration methods into a service
This is doing a bulk of the job of creating a service
for working with math modes configuration. There's
still things to do, like moving math mode names,
and perhaps depending on default user options to
provide a bit more convenience, but that will be the
next step.

Change-Id: I1259a93651920f44104f2f5135e3e620c858be8d
2021-09-28 13:31:08 -07:00

28 lines
597 B
PHP

<?php
use MediaWiki\Extension\Math\MathConfig;
/**
* Test the Id feature
*
* @covers \MediaWiki\Extension\Math\MathRenderer
*
* @group Math
*
* @license GPL-2.0-or-later
*/
class MathIdTest extends MediaWikiIntegrationTestCase {
/**
* Checks if the id specified as attribute is set in the renderer object
*/
public function testBasics() {
$randomId = 'a_random_id';
$renderer = $this->getServiceContainer()
->get( 'Math.RendererFactory' )
->getRenderer( "a+b", [ 'id' => $randomId ], MathConfig::MODE_PNG );
$this->assertEquals( $randomId, $renderer->getID() );
}
}