diff --git a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php index 343486f97..6a5c59da9 100644 --- a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php @@ -1067,6 +1067,16 @@ class HtmlHelperTest extends CakeTestCase { ); $this->assertTags($result, $expected); + $result = $this->Html->scriptBlock('window.foo = 2;', array('type' => 'text/x-handlebars-template')); + $expected = array( + 'script' => array('type' => 'text/x-handlebars-template'), + $this->cDataStart, + 'window.foo = 2;', + $this->cDataEnd, + '/script', + ); + $this->assertTags($result, $expected); + $result = $this->Html->scriptBlock('window.foo = 2;', array('safe' => false)); $expected = array( 'script' => array('type' => 'text/javascript'), @@ -1140,6 +1150,20 @@ class HtmlHelperTest extends CakeTestCase { ); $this->assertTags($result, $expected); + $result = $this->Html->scriptStart(array('safe' => true, 'type' => 'text/x-handlebars-template')); + $this->assertNull($result); + echo 'this is some template'; + + $result = $this->Html->scriptEnd(); + $expected = array( + 'script' => array('type' => 'text/x-handlebars-template'), + $this->cDataStart, + 'this is some template', + $this->cDataEnd, + '/script' + ); + $this->assertTags($result, $expected); + $this->View->expects($this->once()) ->method('append'); $result = $this->Html->scriptStart(array('safe' => false, 'inline' => false)); diff --git a/lib/Cake/View/Helper/HtmlHelper.php b/lib/Cake/View/Helper/HtmlHelper.php index e45e732a3..edce5d34a 100644 --- a/lib/Cake/View/Helper/HtmlHelper.php +++ b/lib/Cake/View/Helper/HtmlHelper.php @@ -98,8 +98,8 @@ class HtmlHelper extends AppHelper { 'ol' => '