mediawiki-extensions-Math/tests/phpunit/MathPngTest.php
Thiemo Kreuz b189280467 Make all @covers tags absolute, and fix some
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
2019-11-26 11:01:23 +01:00

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() );
}
}