summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codeigniter')
-rw-r--r--tests/codeigniter/Setup_test.php2
-rw-r--r--tests/codeigniter/core/Input_test.php10
-rw-r--r--tests/codeigniter/database/query_builder/select_test.php2
-rw-r--r--tests/codeigniter/helpers/file_helper_test.php5
-rw-r--r--tests/codeigniter/helpers/text_helper_test.php7
5 files changed, 13 insertions, 13 deletions
diff --git a/tests/codeigniter/Setup_test.php b/tests/codeigniter/Setup_test.php
index 5317c56c7..43545822a 100644
--- a/tests/codeigniter/Setup_test.php
+++ b/tests/codeigniter/Setup_test.php
@@ -1,6 +1,6 @@
<?php
-class Setup_test extends PHPUnit_Framework_TestCase {
+class Setup_test extends \PHPUnit\Framework\TestCase {
public function test_bootstrap_constants()
{
diff --git a/tests/codeigniter/core/Input_test.php b/tests/codeigniter/core/Input_test.php
index 976941d41..3cce00414 100644
--- a/tests/codeigniter/core/Input_test.php
+++ b/tests/codeigniter/core/Input_test.php
@@ -22,6 +22,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());
@@ -136,7 +144,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]'));
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);
}
// ------------------------------------------------------------------------
diff --git a/tests/codeigniter/helpers/file_helper_test.php b/tests/codeigniter/helpers/file_helper_test.php
index ad56beb28..0d7ae96ee 100644
--- a/tests/codeigniter/helpers/file_helper_test.php
+++ b/tests/codeigniter/helpers/file_helper_test.php
@@ -6,10 +6,7 @@ class File_helper_Test extends CI_TestCase {
{
$this->helper('file');
- vfsStreamWrapper::register();
- vfsStreamWrapper::setRoot(new vfsStreamDirectory('testDir'));
-
- $this->_test_dir = vfsStreamWrapper::getRoot();
+ $this->_test_dir = vfsStream::setup('');
}
// --------------------------------------------------------------------
diff --git a/tests/codeigniter/helpers/text_helper_test.php b/tests/codeigniter/helpers/text_helper_test.php
index b6902c016..7a7dc0a12 100644
--- a/tests/codeigniter/helpers/text_helper_test.php
+++ b/tests/codeigniter/helpers/text_helper_test.php
@@ -64,12 +64,7 @@ class Text_helper_test extends CI_TestCase {
public function test_convert_accented_characters()
{
- $path = 'application/config/foreign_chars.php';
- $this->ci_vfs_clone($path);
- if (is_php('7.4'))
- {
- copy(PROJECT_BASE.$path, APPPATH.'../'.$path);
- }
+ $this->ci_vfs_clone('application/config/foreign_chars.php');
$this->assertEquals('AAAeEEEIIOOEUUUeY', convert_accented_characters('ÀÂÄÈÊËÎÏÔŒÙÛÜŸ'));
$this->assertEquals('a e i o u n ue', convert_accented_characters('á é í ó ú ñ ü'));
}