mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-12-01 02:36:47 +00:00
b189280467
Some mentioned a "__constructor", which should be "__construct". The leading backslash is not strictly needed by all tools. But some need it. I learned it's best practice to always have it. Change-Id: I22fe3a3b4828c02ab5a457aba9af5af1c72567ea
30 lines
638 B
PHP
30 lines
638 B
PHP
<?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() );
|
|
}
|
|
|
|
}
|