summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHeesung Ahn <ahn.heesung@gmail.com>2015-03-17 01:17:59 +0100
committerHeesung Ahn <ahn.heesung@gmail.com>2015-03-17 01:17:59 +0100
commit33992f542185a34c789d85d7709e7f812803a686 (patch)
treecc45b5971e65fbdaa6089b339232ab8b58724247 /tests
parentff806f9157a4a9b32fb40d38ca2cab8130cf66d2 (diff)
Updated fetch_from_array unit test
Signed-off-by:Heesung Ahn <ahn.heesung@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/codeigniter/core/Input_test.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/codeigniter/core/Input_test.php b/tests/codeigniter/core/Input_test.php
index 21ff6d81f..d3f5a9048 100644
--- a/tests/codeigniter/core/Input_test.php
+++ b/tests/codeigniter/core/Input_test.php
@@ -134,6 +134,15 @@ class Input_test extends CI_TestCase {
$this->assertEquals('bar', $foo);
$this->assertEquals("Hello, i try to <script>alert('Hack');</script> your site", $harm);
$this->assertEquals("Hello, i try to [removed]alert&#40;'Hack'&#41;;[removed] your site", $harmless);
+
+ $_SERVER['REQUEST_METHOD'] = 'POST';
+ $_POST['foo']['bar'] = 'baz';
+ $barArray = array( 'bar' => 'baz' );
+
+ $this->assertEquals('baz', $this->input->post('foo[bar]'));
+ $this->assertEquals($barArray, $this->input->post('foo[]'));
+ $this->assertNull($this->input->post('foo[baz]'));
+
}
// --------------------------------------------------------------------