diff --git a/tests/Whoops/Util/TemplateHelperTest.php b/tests/Whoops/Util/TemplateHelperTest.php index c60cb75..880b602 100644 --- a/tests/Whoops/Util/TemplateHelperTest.php +++ b/tests/Whoops/Util/TemplateHelperTest.php @@ -58,4 +58,21 @@ class TemplateHelperTest extends TestCase $this->assertEquals("hello-world", $this->helper->slug("Hello, world!")); $this->assertEquals("potato-class", $this->helper->slug("Potato class")); } + + /** + * @covers Whoops\Util\TemplateHelper::render + */ + public function testRender() + { + $template = __DIR__ . "/../../fixtures/template.php"; + + ob_start(); + $this->helper->render($template, array("name" => "Bb")); + $output = ob_get_clean(); + + $this->assertEquals( + $output, + "hello-world\nMy name is B<o>b" + ); + } } diff --git a/tests/fixtures/template.php b/tests/fixtures/template.php new file mode 100644 index 0000000..4b2fa08 --- /dev/null +++ b/tests/fixtures/template.php @@ -0,0 +1,3 @@ +slug("hello world!"); ?> + +My name is escape($name) ?> \ No newline at end of file