From e437ec4334d3eb54778b954453a7dd3120005162 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 30 Jan 2016 15:29:09 +0100 Subject: [PATCH] Testing against the new `GhostObjectInterface` --- tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php | 7 ++++--- tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php | 5 ++++- tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2306Test.php | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php index d3811f1f3c8..90147ea1657 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php @@ -4,6 +4,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\UnitOfWork; +use ProxyManager\Proxy\GhostObjectInterface; /** * @group DDC-1452 @@ -46,7 +47,7 @@ public function testIssue() $results = $this->_em->createQuery($dql)->setMaxResults(1)->getResult(); $this->assertSame($results[0], $results[0]->entitiesB[0]->entityAFrom); - $this->assertFalse( $results[0]->entitiesB[0]->entityATo instanceof \Doctrine\ORM\Proxy\Proxy ); + $this->assertFalse($results[0]->entitiesB[0]->entityATo instanceof GhostObjectInterface); $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $results[0]->entitiesB[0]->entityATo->getEntitiesB()); } @@ -74,12 +75,12 @@ public function testFetchJoinOneToOneFromInverse() $data = $this->_em->createQuery($dql)->getResult(); $this->_em->clear(); - $this->assertFalse($data[0]->user instanceof \Doctrine\ORM\Proxy\Proxy); + $this->assertFalse($data[0]->user instanceof GhostObjectInterface); $dql = "SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.address a"; $data = $this->_em->createQuery($dql)->getResult(); - $this->assertFalse($data[0]->address instanceof \Doctrine\ORM\Proxy\Proxy); + $this->assertFalse($data[0]->address instanceof GhostObjectInterface); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php index 6fb1d9feb55..62362f352f5 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php @@ -36,7 +36,10 @@ public function testInjectObjectManagerInProxyIfInitializedInUow() $id = $y1ref->doSomething(); - $this->assertTrue($y1ref->isProxyInitialized()); + $this->assertFalse($y1ref->isProxyInitialized()); + + $y1ref->initializeProxy(); + $this->assertEquals($this->_em, $y1ref->om); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2306Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2306Test.php index c468c2b9848..477dc4036eb 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2306Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2306Test.php @@ -55,7 +55,7 @@ public function testIssue() /* @var $address DDC2306Address */ $address = $this->_em->find(__NAMESPACE__ . '\\DDC2306Address', $address->id); - /* @var $user DDC2306User|\Doctrine\ORM\Proxy\Proxy */ + /* @var $user DDC2306User|GhostObjectInterface */ $user = $address->users->first()->user; $this->assertInstanceOf(GhostObjectInterface::class, $user);