mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-12-01 02:36:47 +00:00
88546ae1ad
* currently the phpunit tests are not triggered by jenkins * some test can't be re-enabled possible reasons: ** the texvc and texvccheck binaries are not available from jenkins ** the binaries can not be generated ** the path to the binaries are not set up correctly Bug: T142120 Change-Id: I0c8fe5ad652c4663eeb029781521acbf56e42bad
40 lines
852 B
PHP
40 lines
852 B
PHP
<?php
|
|
|
|
/**
|
|
* Test the TeX source output format.
|
|
*
|
|
* @covers MathRenderer
|
|
*
|
|
* @group Math
|
|
*
|
|
* @license GPL-2.0-or-later
|
|
*/
|
|
class MathSourceTest extends MediaWikiTestCase {
|
|
|
|
/**
|
|
* Checks the basic functionallity
|
|
* i.e. if the span element is generated right.
|
|
*/
|
|
public function testBasics() {
|
|
$real = MathRenderer::renderMath( "a+b", [], 'source' );
|
|
$this->assertEquals(
|
|
'<span class="mwe-math-fallback-source-inline tex" dir="ltr">$ a+b $</span>',
|
|
$real,
|
|
"Rendering of a+b in plain Text mode"
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Checks if newlines are converted to spaces correctly.
|
|
*/
|
|
public function testNewLines() {
|
|
$real = MathRenderer::renderMath( "a\n b", [], 'source' );
|
|
$this->assertSame(
|
|
'<span class="mwe-math-fallback-source-inline tex" dir="ltr">$ a b $</span>',
|
|
$real,
|
|
"converting newlines to spaces"
|
|
);
|
|
}
|
|
|
|
}
|