mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-12-12 07:55:11 +00:00
c416046515
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0 * php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0 Change-Id: Iccba9c52c8390b00fe1cc31e5f3bed3074e27f85
32 lines
711 B
PHP
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() );
|
|
}
|
|
|
|
}
|