mediawiki-extensions-Math/tests/MathSourceTest.php
Moritz Schubotz (Physikerwelt) c5b0b15d8f Fix MathJax centers equations
* Removes the MathJax heuristics that decides
  if equations are centered or left-aligned.
* Introduces the attribute display to specify
  if the math element is rendered in inline,
  display, or inline-displaystyle.
* add css rules for display / inline math images

Bug: 61051
Change-Id: Iba69903f781f0cb1606b8ddcffb90fb86c9b229b
2014-04-06 21:58:30 +00:00

33 lines
810 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"
);
}
}