From e359eafe6cc47323f44c62cbe95e74dab8da7102 Mon Sep 17 00:00:00 2001 From: "Moritz Schubotz (physikerwelt)" Date: Mon, 21 May 2018 12:38:10 +0200 Subject: [PATCH] Improve tests coverage for MathPng Change-Id: Ibb5138512afd20304983be44e0ab45a244634b4b --- tests/phpunit/MathPngTest.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/phpunit/MathPngTest.php diff --git a/tests/phpunit/MathPngTest.php b/tests/phpunit/MathPngTest.php new file mode 100644 index 000000000..236e8babc --- /dev/null +++ b/tests/phpunit/MathPngTest.php @@ -0,0 +1,29 @@ +'; + + 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() ); + } + +}