mediawiki-extensions-Math/tests/MathSourceTest.php
physikerwelt 94b035b26a Coverage tests for the Math extension
* Include generated tests for a better test coverage
of the Math extension.
* Compiles texvc in testsuite (if required)
* Test generator now included
* Replaces the old parser tests
* Fixes whitspace issues

Bug: 61090
Change-Id: Iff7eeb5ee72137492c3f6659e4d4d106e5715586
2014-03-11 15:35:07 +00:00

27 lines
732 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" );
}
}