mediawiki-extensions-Math/tests/phpunit/MathNativeMMLTest.php
Moritz Schubotz (physikerwelt) 88a4c8bc1d
Add minimal native MML mode
* Add minimal POC for native MathML rendering.
* (minor) convert string-based reference to MathConfig to proper access
  method.

Missing:
 *  Error handling
 *  Image fallbacks

Bug: T331047

Change-Id: I7e644c4688cca7fc9af0d54bdc260268c1f6b9df
2023-03-02 20:50:29 +01:00

30 lines
657 B
PHP

<?php
use MediaWiki\Extension\Math\MathNativeMML;
/**
* Test the native MathML output format.
*
* @covers \MediaWiki\Extension\Math\MathNativeMML
*
* @group Math
*
* @license GPL-2.0-or-later
*/
class MathNativeMMLTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->setMwGlobals( 'wgMathValidModes', [ 'native' ] );
}
public function testSin() {
$mml = new MathNativeMML( '\sin' );
$this->assertSame( 'tex', $mml->getInputType() );
$this->assertTrue( $mml->checkTeX() );
$this->assertTrue( $mml->render() );
$this->assertStringContainsString( 'sin', $mml->getMathml() );
}
}