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 bac6570 commit 1e38d7d
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 @@ -229,6 +229,21 @@ public function testLockWithoutEntityThrowsException()
$this->setExpectedException('InvalidArgumentException');
$this->_unitOfWork->lock(null, null, null);
}

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));
}
}

/**
Expand Down

0 comments on commit 1e38d7d

Please sign in to comment.