1
0
mirror of synced 2025-03-06 21:06:16 +03:00

#6017 clear($proxyClassName) should behave like clear($realClassName)

This commit is contained in:
Marco Pivetta 2016-11-27 18:22:01 +01:00
parent fdb2af07e7
commit 9894dcb4b0

View File

@ -373,6 +373,26 @@ class UnitOfWorkTest extends OrmTestCase
$this->_unitOfWork->clear(uniqid('nonExisting', true)); $this->_unitOfWork->clear(uniqid('nonExisting', true));
} }
/**
* @group 6017
*/
public function testClearManagerWithProxyClassName()
{
$proxy = $this->_emMock->getReference(Country::class, ['id' => random_int(457, 100000)]);
$entity = new Country(456, 'United Kingdom');
$this->_unitOfWork->persist($entity);
$this->assertTrue($this->_unitOfWork->isInIdentityMap($entity));
$this->assertTrue($this->_unitOfWork->isScheduledForInsert($entity));
$this->_unitOfWork->clear(get_class($proxy));
$this->assertFalse($this->_unitOfWork->isInIdentityMap($entity));
$this->assertFalse($this->_unitOfWork->isScheduledForInsert($entity));
}
/** /**
* @group 6017 * @group 6017
*/ */