mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-12-04 20:18:35 +00:00
ee2867db2d
MediaWikiTestCase has been renamed to MediaWikiIntegrationTestCase in 1.34. Bug: T293043 Change-Id: Icef9bbb1c515b775ccdcf6bc692c8c2cab4ae503
33 lines
778 B
PHP
33 lines
778 B
PHP
<?php
|
|
|
|
use MediaWiki\Extension\Math\MathConfig;
|
|
use MediaWiki\Extension\Math\MathPng;
|
|
|
|
/**
|
|
* @covers \MediaWiki\Extension\Math\MathPng
|
|
*
|
|
* @license GPL-2.0-or-later
|
|
*/
|
|
class MathPngTest extends MediaWikiIntegrationTestCase {
|
|
|
|
/** @var string The fallback image HTML tag */
|
|
private const TEST_DUMMY = '<img src="test.png" />';
|
|
|
|
public function testConstructor() {
|
|
$renderer = new MathPng( 'a' );
|
|
|
|
$this->assertEquals( MathConfig::MODE_PNG, $renderer->getMode() );
|
|
}
|
|
|
|
public function testOutput() {
|
|
$renderer = $this->getMockBuilder( MathPng::class )
|
|
->onlyMethods( [ 'getFallbackImage' ] )
|
|
->getMock();
|
|
$renderer->method( 'getFallbackImage' )
|
|
->willReturn( self::TEST_DUMMY );
|
|
|
|
$this->assertSame( self::TEST_DUMMY, $renderer->getHtmlOutput() );
|
|
}
|
|
|
|
}
|