mediawiki-extensions-Math/tests/phpunit/MathPngTest.php
libraryupgrader c416046515 build: Updating composer dependencies
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

Change-Id: Iccba9c52c8390b00fe1cc31e5f3bed3074e27f85
2021-05-05 06:48:02 +00:00

32 lines
711 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 )
->onlyMethods( [ 'getFallbackImage' ] )
->getMock();
$renderer->method( 'getFallbackImage' )
->willReturn( self::TEST_DUMMY );
$this->assertSame( self::TEST_DUMMY, $renderer->getHtmlOutput() );
}
}