From 722d4a38f488290ce5d4d0200b9b557288948696 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sat, 10 Jul 2010 14:04:32 +0200 Subject: [PATCH] DDC-130 - fixed a bug in TestCases --- .../Tests/ORM/Functional/ClassTableInheritanceTest.php | 4 +++- .../Tests/ORM/Functional/ManyToManyBasicAssociationTest.php | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php index 5ba6b2aa7..a492444f1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php @@ -318,9 +318,11 @@ class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->persist($employee2); $this->_em->flush(); + $employee1Id = $employee1->getId(); + $this->_em->remove($employee1); $this->_em->flush(); - $this->assertNull($this->_em->find(get_class($employee1), $employee1->getId())); + $this->assertNull($this->_em->find(get_class($employee1), $employee1Id)); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php index 83a522eb1..efb15d2d9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php @@ -209,11 +209,12 @@ class ManyToManyBasicAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCa public function testRemoveUserWithManyGroups() { $user = $this->addCmsUserGblancoWithGroups(2); + $userId = $user->getId(); $this->_em->remove($user); $this->_em->flush(); - $newUser = $this->_em->find(get_class($user), $user->getId()); + $newUser = $this->_em->find(get_class($user), $userId); $this->assertNull($newUser); } @@ -254,6 +255,8 @@ class ManyToManyBasicAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCa $this->_em->persist($user); $this->_em->flush(); + $this->assertNotNull($user->getId(), "User 'gblanco' should have an ID assigned after the persist()/flush() operation."); + return $user; } }