summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/core
diff options
context:
space:
mode:
authorGabriel Caruso <carusogabriel34@gmail.com>2017-12-08 20:25:02 +0100
committerGabriel Caruso <carusogabriel34@gmail.com>2017-12-20 17:43:45 +0100
commitdfa52f3ed31696c58fdc85273f4408559233b19e (patch)
tree63ca4ac93f9fd6f3afe5a91ef25701391ec9e593 /tests/codeigniter/core
parent3ecfcaa94bbae55fec8c2c9bbf8524c49816342f (diff)
Refactoring tests
Diffstat (limited to 'tests/codeigniter/core')
-rw-r--r--tests/codeigniter/core/Benchmark_test.php4
-rw-r--r--tests/codeigniter/core/Common_test.php6
-rw-r--r--tests/codeigniter/core/Input_test.php8
-rw-r--r--tests/codeigniter/core/Log_test.php4
-rw-r--r--tests/codeigniter/core/Security_test.php2
-rw-r--r--tests/codeigniter/core/Utf8_test.php2
-rw-r--r--tests/codeigniter/core/compat/password_test.php2
7 files changed, 14 insertions, 14 deletions
diff --git a/tests/codeigniter/core/Benchmark_test.php b/tests/codeigniter/core/Benchmark_test.php
index 63b0e3d5a..33bd742b2 100644
--- a/tests/codeigniter/core/Benchmark_test.php
+++ b/tests/codeigniter/core/Benchmark_test.php
@@ -15,7 +15,7 @@ class Benchmark_test extends CI_TestCase {
$this->benchmark->mark('code_start');
- $this->assertEquals(1, count($this->benchmark->marker));
+ $this->assertCount(1, $this->benchmark->marker);
$this->assertArrayHasKey('code_start', $this->benchmark->marker);
}
@@ -64,4 +64,4 @@ class Benchmark_test extends CI_TestCase {
$this->assertEquals('{memory_usage}', $this->benchmark->memory_usage());
}
-} \ No newline at end of file
+}
diff --git a/tests/codeigniter/core/Common_test.php b/tests/codeigniter/core/Common_test.php
index ca19e5de0..effae50c5 100644
--- a/tests/codeigniter/core/Common_test.php
+++ b/tests/codeigniter/core/Common_test.php
@@ -4,8 +4,8 @@ class Common_test extends CI_TestCase {
public function test_is_php()
{
- $this->assertEquals(TRUE, is_php('1.2.0'));
- $this->assertEquals(FALSE, is_php('9999.9.9'));
+ $this->assertTrue(is_php('1.2.0'));
+ $this->assertFalse(is_php('9999.9.9'));
}
// ------------------------------------------------------------------------
@@ -66,4 +66,4 @@ class Common_test extends CI_TestCase {
$removed_string = 'Here is a string containing url_encoded invisible text.';
$this->assertEquals($removed_string, remove_invisible_characters($raw_string));
}
-} \ No newline at end of file
+}
diff --git a/tests/codeigniter/core/Input_test.php b/tests/codeigniter/core/Input_test.php
index e068a84be..80cb9a740 100644
--- a/tests/codeigniter/core/Input_test.php
+++ b/tests/codeigniter/core/Input_test.php
@@ -20,8 +20,8 @@ class Input_test extends CI_TestCase {
public function test_get_not_exists()
{
- $this->assertTrue($this->input->get() === array());
- $this->assertTrue($this->input->get('foo') === NULL);
+ $this->assertSame(array(), $this->input->get());
+ $this->assertNull($this->input->get('foo'));
}
// --------------------------------------------------------------------
@@ -51,8 +51,8 @@ class Input_test extends CI_TestCase {
public function test_post_not_exists()
{
- $this->assertTrue($this->input->post() === array());
- $this->assertTrue($this->input->post('foo') === NULL);
+ $this->assertSame(array(), $this->input->post());
+ $this->assertNull($this->input->post('foo'));
}
// --------------------------------------------------------------------
diff --git a/tests/codeigniter/core/Log_test.php b/tests/codeigniter/core/Log_test.php
index d5a6fcb6b..103af342b 100644
--- a/tests/codeigniter/core/Log_test.php
+++ b/tests/codeigniter/core/Log_test.php
@@ -28,7 +28,7 @@ class Log_test extends CI_TestCase {
$this->assertEquals($date_fmt->getValue($instance), 'd.m.Y');
$this->assertEquals($file_ext->getValue($instance), 'php');
$this->assertEquals($file_perms->getValue($instance), 0644);
- $this->assertEquals($enabled->getValue($instance), FALSE);
+ $this->assertFalse($enabled->getValue($instance));
$this->ci_set_config('log_path', '');
$this->ci_set_config('log_threshold', '0');
@@ -60,4 +60,4 @@ class Log_test extends CI_TestCase {
"LEVEL - Timestamp --> Message\n"
);
}
-} \ No newline at end of file
+}
diff --git a/tests/codeigniter/core/Security_test.php b/tests/codeigniter/core/Security_test.php
index 4dd31f4b1..22c97df8b 100644
--- a/tests/codeigniter/core/Security_test.php
+++ b/tests/codeigniter/core/Security_test.php
@@ -253,7 +253,7 @@ class Security_test extends CI_TestCase {
// Perform hash
$this->security->xss_hash();
- $this->assertTrue(preg_match('#^[0-9a-f]{32}$#iS', $this->security->xss_hash) === 1);
+ $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 f40bb9848..8ae51b8af 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->assertTrue(in_array($utf8->clean_string($illegal_utf8), array('тест', ''), TRUE));
+ $this->assertContains($utf8->clean_string($illegal_utf8), array('тест', ''));
}
else
{
diff --git a/tests/codeigniter/core/compat/password_test.php b/tests/codeigniter/core/compat/password_test.php
index 77f5eba4e..b6dbcfab1 100644
--- a/tests/codeigniter/core/compat/password_test.php
+++ b/tests/codeigniter/core/compat/password_test.php
@@ -156,4 +156,4 @@ class password_test extends CI_TestCase {
$this->assertTrue(password_verify('rasmuslerdorf', '$2a$07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi'));
}
-} \ No newline at end of file
+}