#1338 DDC-3619 - moved test to unit of work tests
This commit is contained in:
parent
bac6570af1
commit
1e38d7d07e
@ -229,6 +229,21 @@ class UnitOfWorkTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
$this->setExpectedException('InvalidArgumentException');
|
$this->setExpectedException('InvalidArgumentException');
|
||||||
$this->_unitOfWork->lock(null, null, null);
|
$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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user