summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/core
diff options
context:
space:
mode:
authorGeorge Petculescu <gxgpet@gmail.com>2021-05-31 12:32:13 +0200
committerGeorge Petculescu <gxgpet@gmail.com>2021-05-31 12:32:13 +0200
commitd1d3e69e90ecdfa9ebe1a766198438815b30eee6 (patch)
treeede5fde6350171171f57f9fe34d46df0ae9b5b26 /tests/codeigniter/core
parent81c793551d2bd6c2919a9a46462d464965c8207f (diff)
other test fixes
Diffstat (limited to 'tests/codeigniter/core')
-rw-r--r--tests/codeigniter/core/Input_test.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/codeigniter/core/Input_test.php b/tests/codeigniter/core/Input_test.php
index 07a99e136..93d1b7118 100644
--- a/tests/codeigniter/core/Input_test.php
+++ b/tests/codeigniter/core/Input_test.php
@@ -18,6 +18,14 @@ class Input_test extends CI_TestCase {
// --------------------------------------------------------------------
+ public function tear_down()
+ {
+ $_POST = [];
+ $_GET = [];
+ }
+
+ // --------------------------------------------------------------------
+
public function test_get_not_exists()
{
$this->assertSame(array(), $this->input->get());
@@ -93,7 +101,7 @@ class Input_test extends CI_TestCase {
public function test_post_get_array_notation()
{
$_SERVER['REQUEST_METHOD'] = 'POST';
- $_POST['foo']['bar'] = 'baz';
+ $_POST['foo'] = array('bar' => 'baz');
$barArray = array('bar' => 'baz');
$this->assertEquals('baz', $this->input->get_post('foo[bar]'));
@@ -120,7 +128,7 @@ class Input_test extends CI_TestCase {
public function test_get_post_array_notation()
{
$_SERVER['REQUEST_METHOD'] = 'GET';
- $_GET['foo']['bar'] = 'baz';
+ $_GET['foo'] = array('bar' => 'baz');
$barArray = array('bar' => 'baz');
$this->assertEquals('baz', $this->input->get_post('foo[bar]'));
@@ -169,7 +177,7 @@ class Input_test extends CI_TestCase {
$this->assertEquals("Hello, i try to [removed]alert&#40;'Hack'&#41;;[removed] your site", $harmless);
$_SERVER['REQUEST_METHOD'] = 'POST';
- $_POST['foo']['bar'] = 'baz';
+ $_POST['foo'] = array('bar' => 'baz');
$barArray = array('bar' => 'baz');
$this->assertEquals('baz', $this->input->post('foo[bar]'));