mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-28 09:20:42 +00:00
80bf30ca45
Change-Id: I45be8ea1b9a9a974614354c0199e3107a5cdc23e
33 lines
746 B
PHP
33 lines
746 B
PHP
<?php
|
|
/**
|
|
* Test the TeX source output format.
|
|
* @group Math
|
|
*/
|
|
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", array(), MW_MATH_SOURCE );
|
|
$this->assertEquals(
|
|
'<span class="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", array(), MW_MATH_SOURCE );
|
|
$this->assertSame(
|
|
'<span class="tex" dir="ltr">$ a b $</span>',
|
|
$real,
|
|
"converting newlines to spaces"
|
|
);
|
|
}
|
|
|
|
} |