createMock(Parsedown::class); $extension = new Markdown($renderer); $filters = $extension->getFilters(); $this->assertExtensionExists('markdown', [$extension, 'render'], $filters); $this->assertExtensionExists('md', [$extension, 'render'], $filters); } /** * @covers \Engelsystem\Renderer\Twig\Extensions\Markdown::__construct * @covers \Engelsystem\Renderer\Twig\Extensions\Markdown::render */ public function testRender() { /** @var Parsedown|MockObject $renderer */ $renderer = $this->createMock(Parsedown::class); $return = '
Lorem "Ipsum"
'; $renderer->expects($this->once()) ->method('text') ->with('Lorem *"Ipsum"*') ->willReturn($return); $extension = new Markdown($renderer); $this->assertEquals($return, $extension->render('Lorem *"Ipsum"*')); } }