Permalink
Browse files

Allow setting different type on scriptStart + scriptEnd

  • Loading branch information...
gilleswittenberg committed May 18, 2013
1 parent f19615a commit 6d996d52cef8b10960ce9e75609a658584540831
Showing with 15 additions and 1 deletion.
  1. +14 −0 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
  2. +1 −1 lib/Cake/View/Helper/HtmlHelper.php
@@ -1150,6 +1150,20 @@ public function testScriptStartAndScriptEnd() {
);
$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));
@@ -99,7 +99,7 @@ class HtmlHelper extends AppHelper {
'li' => '<li%s>%s</li>',
'error' => '<div%s>%s</div>',
'javascriptblock' => '<script%s>%s</script>',
- 'javascriptstart' => '<script type="text/javascript">',
+ 'javascriptstart' => '<script>',
'javascriptlink' => '<script type="text/javascript" src="%s"%s></script>',
'javascriptend' => '</script>'
);

0 comments on commit 6d996d5

Please sign in to comment.