Skip to content

Commit

Permalink
#1338 DDC-3619 - moved test to unit of work tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Mar 17, 2015
1 parent b492d61 commit b721841
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Doctrine/Tests/ORM/UnitOfWorkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,21 @@ public function testRejectsChangeSetComputationForObjectsWithInvalidAssociationV
$this->_unitOfWork->computeChangeSet($metadata, $user);
}

public function testRemovedAndRePersistedEntitiesAreInTheIdentityMapAndAreNotGarbageCollected()
{
$entity = new ForumUser();
$entity->id = 123;

$this->_unitOfWork->registerManaged($entity, array('id' => 123), array());
$this->assertTrue($this->_unitOfWork->isInIdentityMap($entity));

$this->_unitOfWork->remove($entity);
$this->assertFalse($this->_unitOfWork->isInIdentityMap($entity));

$this->_unitOfWork->persist($entity);
$this->assertTrue($this->_unitOfWork->isInIdentityMap($entity));
}

/**
* Data Provider
*
Expand Down

0 comments on commit b721841

Please sign in to comment.