Doctrine\Tests\ODM\CouchDB\Proxy\ProxyFactoryTest::testReferenceProxyDelegatesLoadingToThePersister PHP Method

testReferenceProxyDelegatesLoadingToThePersister() public method

    public function testReferenceProxyDelegatesLoadingToThePersister()
    {
        $proxyClass = 'Proxies\\__CG__\\Doctrine\\Tests\\Models\\ECommerce\\ECommerceFeature';
        $modelClass = 'Doctrine\\Tests\\Models\\ECommerce\\ECommerceFeature';
        $query = array('documentName' => '\\' . $modelClass, 'id' => 'SomeUUID');
        $uowMock = $this->getMock('Doctrine\\ODM\\CouchDB\\UnitOfWork', array('refresh'), array(), '', false);
        $uowMock->expects($this->atLeastOnce())->method('refresh')->with($this->isInstanceOf($proxyClass));
        $dmMock = new DocumentManagerMock();
        $dmMock->setUnitOfWorkMock($uowMock);
        $this->proxyFactory = new ProxyFactory($dmMock, __DIR__ . '/generated', 'Proxies', true);
        $proxy = $this->proxyFactory->getProxy($modelClass, $query['id'], $query['documentName']);
        $this->assertInstanceOf('Doctrine\\ODM\\CouchDB\\Proxy\\Proxy', $proxy);
        $proxy->getDescription();
    }