mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2025-01-05 19:34:07 +00:00
9b7205599c
This is doing a bulk of the job of creating a service for working with math modes configuration. There's still things to do, like moving math mode names, and perhaps depending on default user options to provide a bit more convenience, but that will be the next step. Change-Id: I1259a93651920f44104f2f5135e3e620c858be8d
33 lines
767 B
PHP
33 lines
767 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 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( 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() );
|
|
}
|
|
|
|
}
|