2018-05-21 10:38:10 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2019-11-26 09:59:54 +00:00
|
|
|
* @covers \MathPng
|
2018-05-21 10:38:10 +00:00
|
|
|
*
|
|
|
|
* @license GPL-2.0-or-later
|
|
|
|
*/
|
|
|
|
class MathPngTest extends MediaWikiTestCase {
|
|
|
|
|
|
|
|
/** @var string The fallback image HTML tag */
|
2020-05-30 01:13:31 +00:00
|
|
|
private const TEST_DUMMY = '<img src="test.png" />';
|
2018-05-21 10:38:10 +00:00
|
|
|
|
|
|
|
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() );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|