Merge pull request #5354 from carusogabriel/refactoring-tests
Refactoring tests
Conflicts resolved:
tests/codeigniter/core/Utf8_test.php
tests/codeigniter/database/query_builder/group_test.php
tests/codeigniter/libraries/Form_validation_test.php
diff --git a/tests/codeigniter/database/query_builder/where_test.php b/tests/codeigniter/database/query_builder/where_test.php
index 46a7fa2..8a7a09d 100644
--- a/tests/codeigniter/database/query_builder/where_test.php
+++ b/tests/codeigniter/database/query_builder/where_test.php
@@ -36,7 +36,7 @@
public function test_where_custom_key_value()
{
$jobs = $this->db->where('id !=', 1)->get('job')->result_array();
- $this->assertEquals(3, count($jobs));
+ $this->assertCount(3, $jobs);
}
// ------------------------------------------------------------------------
@@ -49,7 +49,7 @@
$where = array('id >' => 2, 'name !=' => 'Accountant');
$jobs = $this->db->where($where)->get('job')->result_array();
- $this->assertEquals(1, count($jobs));
+ $this->assertCount(1, $jobs);
// Should be Musician
$job = current($jobs);
@@ -66,7 +66,7 @@
$where = "id > 2 AND name != 'Accountant'";
$jobs = $this->db->where($where)->get('job')->result_array();
- $this->assertEquals(1, count($jobs));
+ $this->assertCount(1, $jobs);
// Should be Musician
$job = current($jobs);
@@ -85,7 +85,7 @@
->get('job')
->result_array();
- $this->assertEquals(3, count($jobs));
+ $this->assertCount(3, $jobs);
$this->assertEquals('Developer', $jobs[0]['name']);
$this->assertEquals('Politician', $jobs[1]['name']);
$this->assertEquals('Musician', $jobs[2]['name']);
@@ -102,7 +102,7 @@
->get('job')
->result_array();
- $this->assertEquals(2, count($jobs));
+ $this->assertCount(2, $jobs);
$this->assertEquals('Politician', $jobs[0]['name']);
$this->assertEquals('Accountant', $jobs[1]['name']);
}
@@ -118,7 +118,7 @@
->get('job')
->result_array();
- $this->assertEquals(2, count($jobs));
+ $this->assertCount(2, $jobs);
$this->assertEquals('Developer', $jobs[0]['name']);
$this->assertEquals('Musician', $jobs[1]['name']);
}
@@ -131,4 +131,4 @@
$sql = $this->db->where('foo', $input)->get_compiled_select('dummy');
$this->assertEquals("'".$input."'", substr($sql, -20));
}
-}
\ No newline at end of file
+}