diff options
author | Andrey Andreev <narf@devilix.net> | 2021-09-14 12:47:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 12:47:31 +0200 |
commit | 4fa09ccaa80770ed11a2fdf6f1e28c5e14914be4 (patch) | |
tree | 69cae04c446204d3500f117048e4092120787b04 /tests/codeigniter/core | |
parent | 83a4588893dc1cde7d890a2461ac8af6efbf8ad7 (diff) | |
parent | c7e171e0d83d7092d459c2754a1ee3aba33e43ef (diff) |
Merge pull request #6045 from gxgpet/develop_fixtravis
Fixes Travis pipeline. Adding PHPUnit 8.
Diffstat (limited to 'tests/codeigniter/core')
-rw-r--r-- | tests/codeigniter/core/Input_test.php | 14 |
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('Hack');[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]')); |