mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-14 19:26:08 +00:00
b0f07ee605
Change-Id: I7ba90b35e5b6f6e4c296079fc524667ea41c0980
32 lines
710 B
PHP
32 lines
710 B
PHP
<?php
|
|
|
|
use MediaWiki\Extension\Math\MathPng;
|
|
|
|
/**
|
|
* @covers \MediaWiki\Extension\Math\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() );
|
|
}
|
|
|
|
}
|