Skip to content

Commit

Permalink
Allow setting different type on scriptStart + scriptEnd
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilles Wittenberg committed May 21, 2013
1 parent f19615a commit 6d996d5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/HtmlHelper.php
Expand Up @@ -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>'
);
Expand Down

0 comments on commit 6d996d5

Please sign in to comment.