summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/codeigniter/core/Input_test.php14
-rw-r--r--tests/codeigniter/database/query_builder/select_test.php2
2 files changed, 12 insertions, 4 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]'));
diff --git a/tests/codeigniter/database/query_builder/select_test.php b/tests/codeigniter/database/query_builder/select_test.php
index 93b5c3d46..facda791f 100644
--- a/tests/codeigniter/database/query_builder/select_test.php
+++ b/tests/codeigniter/database/query_builder/select_test.php
@@ -74,7 +74,7 @@ class Select_test extends CI_TestCase {
->row();
// Average should be 2.5
- $this->assertEquals('2.5', $job_avg->id);
+ $this->assertEquals(2.5, (float) $job_avg->id);
}
// ------------------------------------------------------------------------