diff options
Diffstat (limited to 'tests/codeigniter/database')
-rw-r--r-- | tests/codeigniter/database/query_builder/group_test.php | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/tests/codeigniter/database/query_builder/group_test.php b/tests/codeigniter/database/query_builder/group_test.php index 5249f7c87..785754ec1 100644 --- a/tests/codeigniter/database/query_builder/group_test.php +++ b/tests/codeigniter/database/query_builder/group_test.php @@ -48,4 +48,74 @@ class Group_test extends CI_TestCase { $this->assertEquals(2, count($jobs)); } + // ------------------------------------------------------------------------ + + /** + * @see ./mocks/schema/skeleton.php + */ + public function test_having_in() + { + $jobs = $this->db->select('name') + ->from('job') + ->group_by('name') + ->having_in('SUM(id)', array(1, 2, 5)) + ->get() + ->result_array(); + + $this->assertEquals(2, count($jobs)); + } + + // ------------------------------------------------------------------------ + + /** + * @see ./mocks/schema/skeleton.php + */ + public function test_or_having_in() + { + $jobs = $this->db->select('name') + ->from('job') + ->group_by('name') + ->or_having_in('SUM(id)', array(1, 5)) + ->or_having_in('SUM(id)', array(2, 6)) + ->get() + ->result_array(); + + $this->assertEquals(2, count($jobs)); + } + + // ------------------------------------------------------------------------ + + /** + * @see ./mocks/schema/skeleton.php + */ + public function test_having_not_in() + { + $jobs = $this->db->select('name') + ->from('job') + ->group_by('name') + ->having_not_in('SUM(id)', array(3, 6)) + ->get() + ->result_array(); + + $this->assertEquals(3, count($jobs)); + } + + // ------------------------------------------------------------------------ + + /** + * @see ./mocks/schema/skeleton.php + */ + public function test_or_having_not_in() + { + $jobs = $this->db->select('name') + ->from('job') + ->group_by('name') + ->or_having_not_in('SUM(id)', array(1, 2, 3)) + ->or_having_not_in('SUM(id)', array(1, 3, 4)) + ->get() + ->result_array(); + + $this->assertEquals(2, count($jobs)); + } + }
\ No newline at end of file |