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