mirror of
https://github.com/filp/whoops.git
synced 2026-09-05 15:08:19 +00:00
Add test for TemplateHelper::render
This commit is contained in:
@@ -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" => "B<o>b"));
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertEquals(
|
||||
$output,
|
||||
"hello-world\nMy name is B<o>b"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
<?php echo $tpl->slug("hello world!"); ?>
|
||||
|
||||
My name is <?php echo $tpl->escape($name) ?>
|
||||
Reference in New Issue
Block a user