diff options
author | Andy Staudacher <andy.st@gmail.com> | 2009-08-30 15:21:02 -0700 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2009-08-30 15:21:02 -0700 |
commit | beb711d6a0fedac0d4ca3b9bae162a6ce9d6cdeb (patch) | |
tree | bfb916d5c36c686b4ebcdab8e8c820b7f5302ace /modules/gallery/tests/Html_Helper_Test.php | |
parent | b5813f92c7a73e11d47d1943c217fdf6b7e41de9 (diff) |
Rename clean_js to js_string and have it return a complete JS string (with delimiters) instead of just the string contents.
Benefits: Using json_encode(), which is very robust. And as a user, it's clearer how to use this API compared to what it was before.
Diffstat (limited to 'modules/gallery/tests/Html_Helper_Test.php')
-rw-r--r-- | modules/gallery/tests/Html_Helper_Test.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/gallery/tests/Html_Helper_Test.php b/modules/gallery/tests/Html_Helper_Test.php index a9903256..f5ce7fa4 100644 --- a/modules/gallery/tests/Html_Helper_Test.php +++ b/modules/gallery/tests/Html_Helper_Test.php @@ -40,9 +40,9 @@ class Html_Helper_Test extends Unit_Test_Case { $safe_string_2); } - public function clean_js_test() { - $string = html::clean_js("hello's <p >world</p>"); - $this->assert_equal("hello\\'s <p >world<\\/p>", + public function js_string_test() { + $string = html::js_string("hello's <p >world</p>"); + $this->assert_equal('"hello\'s <p >world<\\/p>"', $string); } |