mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-12-12 07:55:11 +00:00
2c220ddabc
Bug: T253169 Change-Id: I816b6d26471527137cbddd313cd432f0a37db891
30 lines
646 B
PHP
30 lines
646 B
PHP
<?php
|
|
|
|
/**
|
|
* @covers \MathPng
|
|
*
|
|
* @license GPL-2.0-or-later
|
|
*/
|
|
class MathPngTest extends MediaWikiTestCase {
|
|
|
|
/** @var string The fallback image HTML tag */
|
|
private 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() );
|
|
}
|
|
|
|
}
|