mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2025-01-06 11:54:10 +00:00
129f0e4bcc
... and remove some actual copy-paste mistakes. Change-Id: Id2fd83edff774a7f07b0f5436cefe2bf5c0a63f0
40 lines
857 B
PHP
40 lines
857 B
PHP
<?php
|
|
|
|
/**
|
|
* Test the TeX source output format.
|
|
*
|
|
* @covers MathRenderer
|
|
*
|
|
* @group Math
|
|
*
|
|
* @licence GNU GPL v2+
|
|
*/
|
|
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(), '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(), 'source' );
|
|
$this->assertSame(
|
|
'<span class="mwe-math-fallback-source-inline tex" dir="ltr">$ a b $</span>',
|
|
$real,
|
|
"converting newlines to spaces"
|
|
);
|
|
}
|
|
|
|
}
|