summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter
diff options
context:
space:
mode:
authorTaufan Aditya <toopay@taufanaditya.com>2012-05-04 15:43:45 +0200
committerTaufan Aditya <toopay@taufanaditya.com>2012-05-04 15:43:45 +0200
commit44d8d881b401238661d81fc9db10482604b4cf43 (patch)
tree47c70f372fe60da039744734bb65249cb891bc07 /tests/codeigniter
parent1afd479059c3d6f7c46aa0c36aa56cfba7f94226 (diff)
DISTINCT clause API code-coverage
Diffstat (limited to 'tests/codeigniter')
-rw-r--r--tests/codeigniter/database/query_builder/distinct_test.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/codeigniter/database/query_builder/distinct_test.php b/tests/codeigniter/database/query_builder/distinct_test.php
new file mode 100644
index 000000000..925eadb19
--- /dev/null
+++ b/tests/codeigniter/database/query_builder/distinct_test.php
@@ -0,0 +1,34 @@
+<?php
+
+class Distinct_test extends CI_TestCase {
+
+ /**
+ * @var object Database/Query Builder holder
+ */
+ protected $db;
+
+ public function set_up()
+ {
+ $this->db = Mock_Database_Schema_Skeleton::init(DB_DRIVER);
+
+ Mock_Database_Schema_Skeleton::create_tables();
+ Mock_Database_Schema_Skeleton::create_data();
+ }
+
+ // ------------------------------------------------------------------------
+
+ /**
+ * @see ./mocks/schema/skeleton.php
+ */
+ public function test_distinct()
+ {
+ $users = $this->db->select('country')
+ ->distinct()
+ ->get('user')
+ ->result_array();
+
+ // Check the result
+ $this->assertEquals(3, count($users));
+ }
+
+} \ No newline at end of file