summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/database/query_builder/distinct_test.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2012-05-17 15:54:35 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2012-05-17 15:54:35 +0200
commit76c5185c6ed8c44cb0f249afd72677627d54ff3c (patch)
treedb10cc2cc30f731ac8625117f08ad8855efdf816 /tests/codeigniter/database/query_builder/distinct_test.php
parent714252bf88306839484579059e3a447dd93d55c1 (diff)
parente30b3f7afafa2c016cf78cc8bb8a457c2dbcda8c (diff)
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
Diffstat (limited to 'tests/codeigniter/database/query_builder/distinct_test.php')
-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