mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-23 23:25:02 +00:00
Improve tests coverage for MathPng
Change-Id: Ibb5138512afd20304983be44e0ab45a244634b4b
This commit is contained in:
parent
9b2ba59ac9
commit
e359eafe6c
29
tests/phpunit/MathPngTest.php
Normal file
29
tests/phpunit/MathPngTest.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @covers MathPng
|
||||
*
|
||||
* @license GPL-2.0-or-later
|
||||
*/
|
||||
class MathPngTest extends MediaWikiTestCase {
|
||||
|
||||
/** @var string The fallback image HTML tag */
|
||||
const TEST_DUMMY = '<img src="test.png" />';
|
||||
|
||||
public function testConstructor() {
|
||||
$renderer = new MathPng( 'a' );
|
||||
|
||||
$this->assertEquals( 'png', $renderer->getMode() );
|
||||
}
|
||||
|
||||
public function testOutput() {
|
||||
$renderer = $this->getMockBuilder( MathPng::class )
|
||||
->setMethods( [ 'getFallbackImage' ] )
|
||||
->getMock();
|
||||
$renderer->method( 'getFallbackImage' )
|
||||
->willReturn( self::TEST_DUMMY );
|
||||
|
||||
$this->assertSame( self::TEST_DUMMY, $renderer->getHtmlOutput() );
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue