summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/core
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2022-01-05 16:32:10 +0100
committerAndrey Andreev <narf@devilix.net>2022-01-05 16:32:10 +0100
commit2fa66ba7c6840ac851ae7da2889e7fb654dcda07 (patch)
tree70573048d629ecc51804507c7868356fad323860 /tests/codeigniter/core
parentefc96b71e4b1d13d713d8b2be01796b7d30e6f9b (diff)
parent1d0315b6b3d7003bfb348ccaf7ee30d2533635de (diff)
Merge branch '3.1-stable' into develop
Diffstat (limited to 'tests/codeigniter/core')
-rw-r--r--tests/codeigniter/core/Input_test.php8
-rw-r--r--tests/codeigniter/core/Security_test.php5
-rw-r--r--tests/codeigniter/core/Utf8_test.php2
-rw-r--r--tests/codeigniter/core/compat/mbstring_test.php10
4 files changed, 18 insertions, 7 deletions
diff --git a/tests/codeigniter/core/Input_test.php b/tests/codeigniter/core/Input_test.php
index 93d1b7118..72198b905 100644
--- a/tests/codeigniter/core/Input_test.php
+++ b/tests/codeigniter/core/Input_test.php
@@ -26,6 +26,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());
diff --git a/tests/codeigniter/core/Security_test.php b/tests/codeigniter/core/Security_test.php
index e6a980e7a..5132e5887 100644
--- a/tests/codeigniter/core/Security_test.php
+++ b/tests/codeigniter/core/Security_test.php
@@ -253,7 +253,10 @@ class Security_test extends CI_TestCase {
// Perform hash
$this->security->xss_hash();
- $this->assertMatchesRegularExpression('#^[0-9a-f]{32}$#iS', $this->security->xss_hash);
+ $assertRegExp = class_exists('PHPUnit_Runner_Version')
+ ? 'assertRegExp'
+ : 'assertMatchesRegularExpression';
+ $this->$assertRegExp('#^[0-9a-f]{32}$#iS', $this->security->xss_hash);
}
// --------------------------------------------------------------------
diff --git a/tests/codeigniter/core/Utf8_test.php b/tests/codeigniter/core/Utf8_test.php
index 8ae51b8af..776213204 100644
--- a/tests/codeigniter/core/Utf8_test.php
+++ b/tests/codeigniter/core/Utf8_test.php
@@ -59,7 +59,7 @@ class Utf8_test extends CI_TestCase {
elseif (ICONV_ENABLED)
{
// This is a known issue, iconv doesn't always work with //IGNORE
- $this->assertContains($utf8->clean_string($illegal_utf8), array('тест', ''));
+ $this->assertContains($this->utf8->clean_string($illegal_utf8), array('тест', ''));
}
else
{
diff --git a/tests/codeigniter/core/compat/mbstring_test.php b/tests/codeigniter/core/compat/mbstring_test.php
index 8b8629efc..39f48ac10 100644
--- a/tests/codeigniter/core/compat/mbstring_test.php
+++ b/tests/codeigniter/core/compat/mbstring_test.php
@@ -31,9 +31,9 @@ class mbstring_test extends CI_TestCase {
*/
public function test_mb_strpos()
{
- $this->assertEquals(ICONV_ENABLED ? 3 : 6, mb_strpos('тест', 'с'));
+ $this->assertEquals(ICONV_ENABLED ? 2 : 4, mb_strpos('тест', 'с'));
$this->assertFalse(mb_strpos('тест', 'с', 3));
- $this->assertEquals(ICONV_ENABLED ? 3 : 6, mb_strpos('тест', 'с', 1, 'UTF-8'));
+ $this->assertEquals(ICONV_ENABLED ? 2 : 4, mb_strpos('тест', 'с', 1, 'UTF-8'));
}
// ------------------------------------------------------------------------
@@ -46,9 +46,9 @@ class mbstring_test extends CI_TestCase {
$this->assertEquals(ICONV_ENABLED ? 'стинг' : 'естинг', mb_substr('тестинг', 2));
$this->assertEquals(ICONV_ENABLED ? 'нг' : 'г', mb_substr('тестинг', -2));
$this->assertEquals(ICONV_ENABLED ? 'ст' : 'е', mb_substr('тестинг', 2, 2));
- $this->assertEquals(ICONV_ENABLED ? 'стинг' : 'естинг', mb_substr('тестинг', 2, 'UTF-8'));
- $this->assertEquals(ICONV_ENABLED ? 'нг' : 'г', mb_substr('тестинг', -2, 'UTF-8'));
+ $this->assertEquals(ICONV_ENABLED ? 'стинг' : 'естинг', mb_substr('тестинг', 2, NULL, 'UTF-8'));
+ $this->assertEquals(ICONV_ENABLED ? 'нг' : 'г', mb_substr('тестинг', -2, NULL, 'UTF-8'));
$this->assertEquals(ICONV_ENABLED ? 'ст' : 'е', mb_substr('тестинг', 2, 2, 'UTF-8'));
}
-} \ No newline at end of file
+}