getServiceContainer() ->get( 'Math.RendererFactory' ) ->getRenderer( 'a+b', [], MathConfig::MODE_SOURCE ); $renderer->render(); $real = $renderer->getHtmlOutput(); $this->assertEquals( '$ a+b $', $real, "Rendering of a+b in plain Text mode" ); } /** * Checks if newlines are converted to spaces correctly. */ public function testNewLines() { $renderer = $this->getServiceContainer() ->get( 'Math.RendererFactory' ) ->getRenderer( "a\n b", [], MathConfig::MODE_SOURCE ); $renderer->render(); $real = $renderer->getHtmlOutput(); $this->assertSame( '$ a b $', $real, "converting newlines to spaces" ); } public function testConstructor() { $renderer = new MathSource( 'a' ); $this->assertEquals( MathConfig::MODE_SOURCE, $renderer->getMode() ); } public function testRender() { $renderer = new MathSource( 'a+b' ); $this->assertTrue( $renderer->render() ); $this->assertFalse( $renderer->isChanged() ); } }