public function ProxyLogicTest::testLazyLoadingTriggeredOnlyAtFirstPublicPropertyRead in Plug 7
File
- lib/
doctrine/ common/ tests/ Doctrine/ Tests/ Common/ Proxy/ ProxyLogicTest.php, line 188
Class
- ProxyLogicTest
- Test the generated proxies behavior. These tests make assumptions about the structure of LazyLoadableObject
Namespace
Doctrine\Tests\Common\ProxyCode
public function testLazyLoadingTriggeredOnlyAtFirstPublicPropertyRead() {
$test = $this;
$this
->configureInitializerMock(1, array(
$this->lazyObject,
'__get',
array(
'publicPersistentField',
),
), function () use ($test) {
$test
->setProxyValue('publicPersistentField', 'loadedValue');
$test
->setProxyValue('publicAssociation', 'publicAssociationValue');
});
$this
->assertSame('loadedValue', $this->lazyObject->publicPersistentField);
$this
->assertSame('publicAssociationValue', $this->lazyObject->publicAssociation);
}