mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-12-12 16:05:09 +00:00
88a4c8bc1d
* 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
30 lines
657 B
PHP
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() );
|
|
}
|
|
|
|
}
|