Applying fix for failing test for DDC-2230
This commit is contained in:
parent
be24439e2f
commit
350fa4f15b
@ -2659,7 +2659,10 @@ class UnitOfWork implements PropertyChangedListener
|
||||
$this->entityIdentifiers[$newValueOid] = $associatedId;
|
||||
$this->identityMap[$targetClass->rootEntityName][$relatedIdHash] = $newValue;
|
||||
|
||||
if ($newValue instanceof NotifyPropertyChanged) {
|
||||
if (
|
||||
$newValue instanceof NotifyPropertyChanged &&
|
||||
( ! $newValue instanceof Proxy || $newValue->__isInitialized())
|
||||
) {
|
||||
$newValue->addPropertyChangedListener($this);
|
||||
}
|
||||
$this->entityStates[$newValueOid] = self::STATE_MANAGED;
|
||||
@ -3003,7 +3006,7 @@ class UnitOfWork implements PropertyChangedListener
|
||||
|
||||
$this->addToIdentityMap($entity);
|
||||
|
||||
if ($entity instanceof NotifyPropertyChanged) {
|
||||
if ($entity instanceof NotifyPropertyChanged && ( ! $entity instanceof Proxy || $entity->__isInitialized())) {
|
||||
$entity->addPropertyChangedListener($this);
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,14 @@ class DDC1690Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$child = $this->_em->find(__NAMESPACE__.'\DDC1690Child', $childId);
|
||||
|
||||
$this->assertEquals(1, count($parent->listeners));
|
||||
$this->assertEquals(1, count($child->listeners));
|
||||
$this->assertInstanceOf(
|
||||
'Doctrine\\ORM\\Proxy\\Proxy',
|
||||
$child,
|
||||
'Verifying that $child is a proxy before using proxy API'
|
||||
);
|
||||
$this->assertCount(0, $child->listeners);
|
||||
$child->__load();
|
||||
$this->assertCount(1, $child->listeners);
|
||||
unset($parent, $child);
|
||||
|
||||
$parent = $this->_em->find(__NAMESPACE__.'\DDC1690Parent', $parentId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user