From dde09872df4f442f3a2a4c9ce6053badb8b49012 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Fri, 16 Jan 2015 21:09:53 +0100 Subject: [PATCH] #1172 - writing a more concise test case about merging detached proxies --- .../ORM/Functional/MergeUninitializedProxyTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Functional/MergeUninitializedProxyTest.php b/tests/Doctrine/Tests/ORM/Functional/MergeUninitializedProxyTest.php index 43981fcc1..ae5fa5f5a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MergeUninitializedProxyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MergeUninitializedProxyTest.php @@ -22,6 +22,18 @@ class MergeUninitializedProxyTest extends \Doctrine\Tests\OrmFunctionalTestCase } } + public function testMergeUnserializedUnInitializedProxy() + { + $detachedUninitialized = $this->_em->getReference(MUPFile::CLASSNAME, 123); + + $this->_em->clear(); + + $this->assertSame( + $this->_em->getReference(MUPFile::CLASSNAME, 123), + $this->_em->merge(unserialize(serialize($detachedUninitialized))) + ); + } + public function testMergeUnserializedIntoEntity() { $file = new MUPFile; @@ -177,6 +189,8 @@ class MUPPicture */ class MUPFile { + const CLASSNAME = __CLASS__; + /** * @Column(name="file_id", type="integer") * @Id