mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-24 15:44:33 +00:00
94b035b26a
* 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
27 lines
732 B
PHP
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" );
|
|
}
|
|
|
|
} |