#1172 - covering also detached proxies - merging operations should not initialize either proxy
This commit is contained in:
parent
dde09872df
commit
0329ac5074
@ -22,16 +22,35 @@ class MergeUninitializedProxyTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testMergeDetachedUnInitializedProxy()
|
||||||
|
{
|
||||||
|
$detachedUninitialized = $this->_em->getReference(MUPFile::CLASSNAME, 123);
|
||||||
|
|
||||||
|
$this->_em->clear();
|
||||||
|
|
||||||
|
$managed = $this->_em->getReference(MUPFile::CLASSNAME, 123);
|
||||||
|
|
||||||
|
$this->assertSame($managed, $this->_em->merge($detachedUninitialized));
|
||||||
|
|
||||||
|
$this->assertFalse($managed->__isInitialized());
|
||||||
|
$this->assertFalse($detachedUninitialized->__isInitialized());
|
||||||
|
}
|
||||||
|
|
||||||
public function testMergeUnserializedUnInitializedProxy()
|
public function testMergeUnserializedUnInitializedProxy()
|
||||||
{
|
{
|
||||||
$detachedUninitialized = $this->_em->getReference(MUPFile::CLASSNAME, 123);
|
$detachedUninitialized = $this->_em->getReference(MUPFile::CLASSNAME, 123);
|
||||||
|
|
||||||
$this->_em->clear();
|
$this->_em->clear();
|
||||||
|
|
||||||
|
$managed = $this->_em->getReference(MUPFile::CLASSNAME, 123);
|
||||||
|
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
$this->_em->getReference(MUPFile::CLASSNAME, 123),
|
$managed,
|
||||||
$this->_em->merge(unserialize(serialize($detachedUninitialized)))
|
$this->_em->merge(unserialize(serialize($this->_em->merge($detachedUninitialized))))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->assertFalse($managed->__isInitialized());
|
||||||
|
$this->assertFalse($detachedUninitialized->__isInitialized());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testMergeUnserializedIntoEntity() {
|
public function testMergeUnserializedIntoEntity() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user