You are here

public function ProxyLogicTest::testSettingPublicAssociationCausesLazyLoading in Plug 7

File

lib/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyLogicTest.php, line 541

Class

ProxyLogicTest
Test the generated proxies behavior. These tests make assumptions about the structure of LazyLoadableObject

Namespace

Doctrine\Tests\Common\Proxy

Code

public function testSettingPublicAssociationCausesLazyLoading() {
  $test = $this;
  $this
    ->configureInitializerMock(1, array(
    $this->lazyObject,
    '__set',
    array(
      'publicAssociation',
      'newPublicAssociationValue',
    ),
  ), function () use ($test) {
    $test
      ->setProxyValue('publicPersistentField', 'newPublicPersistentFieldValue');
    $test
      ->setProxyValue('publicAssociation', 'overrideValue');
  });
  $this->lazyObject->publicAssociation = 'newPublicAssociationValue';
  $this
    ->assertSame('newPublicAssociationValue', $this->lazyObject->publicAssociation);
  $this
    ->assertSame('newPublicPersistentFieldValue', $this->lazyObject->publicPersistentField);
}