From 85b6d3b9a1b346f36232d98bcf308f5635eb7f49 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sat, 13 Mar 2010 11:08:12 +0100 Subject: [feature/request-class] Extracted type casting helpers from the request class. These methods should be available without having to instantiate a request class object, better separation of concerns. A set_var wrapper around this class no longer requires a request object at all. PHPBB3-9716 --- tests/request/type_cast_helper.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/request/type_cast_helper.php (limited to 'tests/request') diff --git a/tests/request/type_cast_helper.php b/tests/request/type_cast_helper.php new file mode 100644 index 0000000000..aba8523ec3 --- /dev/null +++ b/tests/request/type_cast_helper.php @@ -0,0 +1,33 @@ +type_cast_helper = new phpbb_type_cast_helper(); + } + + public function test_addslashes_recursively() + { + $data = array('some"string' => array('that"' => 'really"', 'needs"' => '"escaping')); + $expected = array('some\\"string' => array('that\\"' => 'really\\"', 'needs\\"' => '\\"escaping')); + + $this->type_cast_helper->addslashes_recursively($data); + + $this->assertEquals($expected, $data); + } +} -- cgit v1.2.1