blob: 81fabe4486de2e2a2b5cd24bdeb548fdd6aa4d05 [file] [log] [blame]
Taufan Aditya44d8d882012-05-04 20:43:45 +07001<?php
2
3class Distinct_test extends CI_TestCase {
4
5 /**
6 * @var object Database/Query Builder holder
7 */
8 protected $db;
9
10 public function set_up()
11 {
12 $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
13
14 Mock_Database_Schema_Skeleton::create_tables();
15 Mock_Database_Schema_Skeleton::create_data();
16 }
17
18 // ------------------------------------------------------------------------
19
20 /**
21 * @see ./mocks/schema/skeleton.php
22 */
23 public function test_distinct()
24 {
25 $users = $this->db->select('country')
Andrey Andreevc1862882012-06-09 23:16:58 +030026 ->distinct()
27 ->get('user')
28 ->result_array();
29
Andrey Andreev20d9b0a2017-12-20 19:57:39 +020030 $this->assertCount(3, $users);
Taufan Aditya44d8d882012-05-04 20:43:45 +070031 }
32
Andrey Andreev20d9b0a2017-12-20 19:57:39 +020033}