From b32bb26a84e9302010e22b9051becc1b6052ba02 Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Wed, 23 May 2012 01:07:29 -0400 Subject: [PATCH] Re-added coverage for DDC-369 and DDC-954. --- .../Tests/Models/Company/CompanyPerson.php | 16 ++++++++++++---- .../ORM/Functional/AdvancedDqlQueryTest.php | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/Doctrine/Tests/Models/Company/CompanyPerson.php b/tests/Doctrine/Tests/Models/Company/CompanyPerson.php index 1bc916d81..4636fa4e3 100644 --- a/tests/Doctrine/Tests/Models/Company/CompanyPerson.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyPerson.php @@ -53,21 +53,29 @@ class CompanyPerson * @GeneratedValue */ private $id; + /** * @Column */ private $name; + /** * @OneToOne(targetEntity="CompanyPerson") - * @JoinColumn(name="spouse_id", referencedColumnName="id") + * @JoinColumn(name="spouse_id", referencedColumnName="id", onDelete="CASCADE") */ private $spouse; /** * @ManyToMany(targetEntity="CompanyPerson") - * @JoinTable(name="company_persons_friends", - joinColumns={@JoinColumn(name="person_id", referencedColumnName="id")}, - inverseJoinColumns={@JoinColumn(name="friend_id", referencedColumnName="id")}) + * @JoinTable( + * name="company_persons_friends", + * joinColumns={ + * @JoinColumn(name="person_id", referencedColumnName="id", onDelete="CASCADE") + * }, + * inverseJoinColumns={ + * @JoinColumn(name="friend_id", referencedColumnName="id", onDelete="CASCADE") + * } + * ) */ private $friends; diff --git a/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php b/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php index ea2583e81..a5c06e3bd 100644 --- a/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php @@ -128,7 +128,7 @@ class AdvancedDqlQueryTest extends \Doctrine\Tests\OrmFunctionalTestCase 'SELECT count(p.id) FROM Doctrine\Tests\Models\Company\CompanyEmployee p WHERE p.salary = 1')->getResult()) > 0); } - /*public function testDeleteAs() + public function testDeleteAs() { $dql = 'DELETE Doctrine\Tests\Models\Company\CompanyEmployee AS p'; $this->_em->createQuery($dql)->getResult(); @@ -137,7 +137,7 @@ class AdvancedDqlQueryTest extends \Doctrine\Tests\OrmFunctionalTestCase $result = $this->_em->createQuery($dql)->getSingleScalarResult(); $this->assertEquals(0, $result); - }*/ + } public function generateFixture() {