From 33992f542185a34c789d85d7709e7f812803a686 Mon Sep 17 00:00:00 2001 From: Heesung Ahn Date: Mon, 16 Mar 2015 20:17:59 -0400 Subject: Updated fetch_from_array unit test Signed-off-by:Heesung Ahn --- tests/codeigniter/core/Input_test.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/codeigniter') 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 your site", $harm); $this->assertEquals("Hello, i try to [removed]alert('Hack');[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]')); + } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b