aboutsummaryrefslogtreecommitdiffstats
path: root/tests/request
diff options
context:
space:
mode:
Diffstat (limited to 'tests/request')
-rw-r--r--tests/request/type_cast_helper.php33
1 files changed, 33 insertions, 0 deletions
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 @@
+<?php
+/**
+*
+* @package testing
+* @version $Id$
+* @copyright (c) 2009 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once 'test_framework/framework.php';
+require_once '../phpBB/includes/request/type_cast_helper_interface.php';
+require_once '../phpBB/includes/request/type_cast_helper.php';
+
+class phpbb_type_cast_helper_test extends phpbb_test_case
+{
+ private $type_cast_helper;
+
+ protected function setUp()
+ {
+ $this->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);
+ }
+}