mediawiki-extensions-Math/tests/MathSourceTest.php
Ori Livneh d9b9b06032 MWException -> Exception
Change-Id: I18da1baeb70387b96e30811a049185a264dec26d
2015-01-09 17:55:54 -08:00

34 lines
811 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="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", array(), MW_MATH_SOURCE );
$this->assertSame(
'<span class="mwe-math-fallback-source-inline tex" dir="ltr">$ a b $</span>',
$real,
"converting newlines to spaces"
);
}
}