From b097669fbe4543682a4cb7cc67bb534623cd773f Mon Sep 17 00:00:00 2001 From: zYne Date: Fri, 8 Jun 2007 20:16:51 +0000 Subject: [PATCH] tests for DISTINCT functionality --- tests/Query/SelectTestCase.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/Query/SelectTestCase.php b/tests/Query/SelectTestCase.php index c728e1f29..f6c49efef 100644 --- a/tests/Query/SelectTestCase.php +++ b/tests/Query/SelectTestCase.php @@ -43,7 +43,22 @@ class Doctrine_Query_Select_TestCase extends Doctrine_UnitTestCase $users = $q->execute(); $this->assertEqual($users[0]->value, 'zYne zYne@example.com'); } + public function testSelectDistinctIsSupported() + { + $q = new Doctrine_Query(); + + $q->distinct()->select('u.name')->from('User u'); + $this->assertEqual($q->getSql(), "SELECT DISTINCT e.id AS e__id, e.name AS e__name FROM entity e WHERE (e.type = 0)"); + } + public function testSelectDistinctIsSupported2() + { + $q = new Doctrine_Query(); + + $q->select('DISTINCT u.name')->from('User u'); + + $this->assertEqual($q->getSql(), "SELECT DISTINCT e.id AS e__id, e.name AS e__name FROM entity e WHERE (e.type = 0)"); + } public function testAggregateFunctionWithDistinctKeyword() { $q = new Doctrine_Query();