Skip to content

Commit

Permalink
doctrine#1169 DDC-3343 - fixing test case typos (referencing wrong/i…
Browse files Browse the repository at this point in the history
…nexisting properties, inexisting owning side assigned
  • Loading branch information
Ocramius committed Feb 5, 2015
1 parent fac410b commit 4884183
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/Doctrine/Tests/Models/Tweet/Tweet.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ class Tweet
*/
public function setAuthor(User $author)
{
$this->user = $author;
$this->author = $author;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,7 @@ public function testRemoveElementOneToMany()
$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();
Expand All @@ -391,7 +390,7 @@ public function testRemoveElementOneToMany()

$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
Expand Down Expand Up @@ -847,7 +846,7 @@ public function testRemoveOrphanedManagedElementFromOneToManyExtraLazyCollection
/* @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();

Expand Down Expand Up @@ -900,7 +899,7 @@ public function testRemoveOrphanedManagedLazyProxyFromExtraLazyOneToMany()
/* @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();

Expand Down

0 comments on commit 4884183

Please sign in to comment.