summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-03-17 10:31:59 +0100
committerAndrey Andreev <narf@devilix.net>2015-03-17 10:31:59 +0100
commit35514731f05c749526939de4812f5288ff3cc007 (patch)
treecc45b5971e65fbdaa6089b339232ab8b58724247
parentff806f9157a4a9b32fb40d38ca2cab8130cf66d2 (diff)
parent33992f542185a34c789d85d7709e7f812803a686 (diff)
Merge pull request #3676 from ahnh/UnitTest_CI_Input_fetch_from_array
Updated fetch_from_array unit 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]'));
+
}
// --------------------------------------------------------------------