Skip to content

Commit

Permalink
Adding test to show proper escaping of escaped strings in Javscript::…
Browse files Browse the repository at this point in the history
…object() closes #6167.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8076 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
markstory committed Mar 6, 2009
1 parent a3809d6 commit 18a7115
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cake/tests/cases/libs/view/helpers/javascript.test.php
Expand Up @@ -648,6 +648,10 @@ function testEscapeString() {
$result = $this->Javascript->escapeString('CakePHP: \'Rapid Development Framework\'');
$expected = 'CakePHP: \\\'Rapid Development Framework\\\'';
$this->assertEqual($result, $expected);

$result = $this->Javascript->escapeString('my \\"string\\"');
$expected = 'my \\\"string\\\"';
$this->assertEqual($result, $expected);
}
/**
* testAfterRender method
Expand Down

0 comments on commit 18a7115

Please sign in to comment.