#5849 #5850 correcting test scenario: identity map could not be built with auto-generated identities+persist
This commit is contained in:
parent
313e4a33e5
commit
34d8e00df7
@ -15,6 +15,8 @@ use Doctrine\Tests\Mocks\UnitOfWorkMock;
|
||||
use Doctrine\Tests\Models\CMS\CmsPhonenumber;
|
||||
use Doctrine\Tests\Models\Forum\ForumAvatar;
|
||||
use Doctrine\Tests\Models\Forum\ForumUser;
|
||||
use Doctrine\Tests\Models\GeoNames\City;
|
||||
use Doctrine\Tests\Models\GeoNames\Country;
|
||||
use Doctrine\Tests\OrmTestCase;
|
||||
use stdClass;
|
||||
|
||||
@ -329,11 +331,8 @@ class UnitOfWorkTest extends OrmTestCase
|
||||
*/
|
||||
public function testPersistedEntityAndClearManager()
|
||||
{
|
||||
$entity1 = new ForumUser();
|
||||
$entity1->id = 123;
|
||||
|
||||
$entity2 = new ForumAvatar();
|
||||
$entity2->id = 456;
|
||||
$entity1 = new City(123, 'London');
|
||||
$entity2 = new Country(456, 'United Kingdom');
|
||||
|
||||
$this->_unitOfWork->persist($entity1);
|
||||
$this->assertTrue($this->_unitOfWork->isInIdentityMap($entity1));
|
||||
@ -341,7 +340,7 @@ class UnitOfWorkTest extends OrmTestCase
|
||||
$this->_unitOfWork->persist($entity2);
|
||||
$this->assertTrue($this->_unitOfWork->isInIdentityMap($entity2));
|
||||
|
||||
$this->_unitOfWork->clear(ForumAvatar::class);
|
||||
$this->_unitOfWork->clear(Country::class);
|
||||
$this->assertTrue($this->_unitOfWork->isInIdentityMap($entity1));
|
||||
$this->assertFalse($this->_unitOfWork->isInIdentityMap($entity2));
|
||||
$this->assertTrue($this->_unitOfWork->isScheduledForInsert($entity1));
|
||||
|
Loading…
x
Reference in New Issue
Block a user