From 3fb5aa5886de15ef68e40b556a6ea3f1badf962e Mon Sep 17 00:00:00 2001 From: tiyowan Date: Fri, 16 Mar 2012 19:08:34 +0400 Subject: Add unit test for strip_slashes() in string_helper.php --- tests/codeigniter/helpers/string_helper_test.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/codeigniter/helpers/string_helper_test.php b/tests/codeigniter/helpers/string_helper_test.php index 2d7f96aa5..a884d6284 100644 --- a/tests/codeigniter/helpers/string_helper_test.php +++ b/tests/codeigniter/helpers/string_helper_test.php @@ -4,6 +4,21 @@ require_once(BASEPATH.'helpers/string_helper.php'); class String_helper_test extends CI_TestCase { + public function test_strip_slashes() + { + $expected = array( + "Is your name O'reilly?", + "No, my name is O'connor." + ); + + $str = array( + "Is your name O\'reilly?", + "No, my name is O\'connor." + ); + + $this->assertEquals($expected, strip_slashes($str)); + } + public function test_trim_slashes() { $strs = array( -- cgit v1.2.3-24-g4f1b