From 6cdb8d993bd69df5d8a0974a7f579c2a23cda0a5 Mon Sep 17 00:00:00 2001 From: zYne Date: Tue, 15 May 2007 17:22:42 +0000 Subject: [PATCH] --- tests/Query/DeleteTestCase.php | 50 +++++++++++++++++++++++---- tests/Query/JoinConditionTestCase.php | 8 ++--- 2 files changed, 48 insertions(+), 10 deletions(-) diff --git a/tests/Query/DeleteTestCase.php b/tests/Query/DeleteTestCase.php index f96f53945..67e207a16 100644 --- a/tests/Query/DeleteTestCase.php +++ b/tests/Query/DeleteTestCase.php @@ -1,6 +1,40 @@ . + */ + +/** + * Doctrine_Query_Delete_TestCase + * This test case is used for testing DQL DELETE queries + * + * @package Doctrine + * @author Konsta Vesterinen + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + */ +class Doctrine_Query_Delete_TestCase extends Doctrine_UnitTestCase +{ + public function testDeleteAllWithColumnAggregationInheritance() + { $q = new Doctrine_Query(); $q->parseQuery('DELETE FROM User'); @@ -13,7 +47,8 @@ class Doctrine_Query_Delete_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($q->getQuery(), 'DELETE FROM entity WHERE (type = 0)'); } - public function testDeleteAll() { + public function testDeleteAll() + { $q = new Doctrine_Query(); $q->parseQuery('DELETE FROM Entity'); @@ -26,7 +61,8 @@ class Doctrine_Query_Delete_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($q->getQuery(), 'DELETE FROM entity'); } - public function testDeleteWithCondition() { + public function testDeleteWithCondition() + { $q = new Doctrine_Query(); $q->parseQuery('DELETE FROM Entity WHERE id = 3'); @@ -39,7 +75,8 @@ class Doctrine_Query_Delete_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($q->getQuery(), 'DELETE FROM entity WHERE id = 3'); } - public function testDeleteWithLimit() { + public function testDeleteWithLimit() + { $q = new Doctrine_Query(); $q->parseQuery('DELETE FROM Entity LIMIT 20'); @@ -52,7 +89,8 @@ class Doctrine_Query_Delete_TestCase extends Doctrine_UnitTestCase { $this->assertEqual($q->getQuery(), 'DELETE FROM entity LIMIT 20'); } - public function testDeleteWithLimitAndOffset() { + public function testDeleteWithLimitAndOffset() + { $q = new Doctrine_Query(); $q->parseQuery('DELETE FROM Entity LIMIT 10 OFFSET 20'); diff --git a/tests/Query/JoinConditionTestCase.php b/tests/Query/JoinConditionTestCase.php index 823fa8203..fa7a8ef25 100644 --- a/tests/Query/JoinConditionTestCase.php +++ b/tests/Query/JoinConditionTestCase.php @@ -38,7 +38,7 @@ class Doctrine_Query_JoinCondition_TestCase extends Doctrine_UnitTestCase { } public function testJoinConditionsAreSupportedForOneToManyLeftJoins() { - $q = new Doctrine_Query(); + $q = new Doctrine_Query2(); $q->parseQuery("SELECT u.name, p.id FROM User u LEFT JOIN u.Phonenumber p ON p.phonenumber = '123 123'"); @@ -46,7 +46,7 @@ class Doctrine_Query_JoinCondition_TestCase extends Doctrine_UnitTestCase } public function testJoinConditionsAreSupportedForOneToManyInnerJoins() { - $q = new Doctrine_Query(); + $q = new Doctrine_Query2(); $q->parseQuery("SELECT u.name, p.id FROM User u INNER JOIN u.Phonenumber p ON p.phonenumber = '123 123'"); @@ -54,7 +54,7 @@ class Doctrine_Query_JoinCondition_TestCase extends Doctrine_UnitTestCase } public function testJoinConditionsAreSupportedForManyToManyLeftJoins() { - $q = new Doctrine_Query(); + $q = new Doctrine_Query2(); $q->parseQuery("SELECT u.name, g.id FROM User u LEFT JOIN u.Group g ON g.id > 2"); @@ -62,7 +62,7 @@ class Doctrine_Query_JoinCondition_TestCase extends Doctrine_UnitTestCase } public function testJoinConditionsAreSupportedForManyToManyInnerJoins() { - $q = new Doctrine_Query(); + $q = new Doctrine_Query2(); $q->parseQuery("SELECT u.name, g.id FROM User u INNER JOIN u.Group g ON g.id > 2");