From 4884183b957dd2e481ba17f203a863b8424ba809 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 5 Feb 2015 00:11:19 +0000 Subject: [PATCH] #1169 DDC-3343 - fixing test case typos (referencing wrong/inexisting properties, inexisting owning side assigned --- tests/Doctrine/Tests/Models/Tweet/Tweet.php | 2 +- .../Tests/ORM/Functional/ExtraLazyCollectionTest.php | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/Doctrine/Tests/Models/Tweet/Tweet.php b/tests/Doctrine/Tests/Models/Tweet/Tweet.php index 14411dc2a..9f564e27b 100644 --- a/tests/Doctrine/Tests/Models/Tweet/Tweet.php +++ b/tests/Doctrine/Tests/Models/Tweet/Tweet.php @@ -32,6 +32,6 @@ class Tweet */ public function setAuthor(User $author) { - $this->user = $author; + $this->author = $author; } } diff --git a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php index 2c6fd6faf..daf7a2613 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php @@ -369,8 +369,7 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase $user->articles->removeElement($article); $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); - // NOTE: +2 queries because CmsArticle is a versioned entity, and that needs to be handled accordingly - $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount()); + $this->assertEquals($queryCount, $this->getCurrentQueryCount()); // Test One to Many removal with Entity state as new $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); @@ -391,7 +390,7 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase $user->articles->removeElement($article); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Removing a persisted entity will not cause queries when the owning side doesn't actually change."); + $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Removing a persisted entity should cause one query to be executed."); $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); // Test One to Many removal with Entity state as managed @@ -847,7 +846,7 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase /* @var $user User */ $user = $this->_em->find(User::CLASSNAME, $userId); - $user->tweets->removeElement($this->_em->find(UserList::CLASSNAME, $userListId)); + $user->userLists->removeElement($this->_em->find(UserList::CLASSNAME, $userListId)); $this->_em->clear(); @@ -900,7 +899,7 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase /* @var $user User */ $user = $this->_em->find(User::CLASSNAME, $userId); - $user->tweets->removeElement($this->_em->getReference(UserList::CLASSNAME, $userListId)); + $user->userLists->removeElement($this->_em->getReference(UserList::CLASSNAME, $userListId)); $this->_em->clear();