You are here

public function ProxyMagicMethodsTest::testClonesPrivateProperties in Plug 7

@group DCOM-175

File

lib/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php, line 236

Class

ProxyMagicMethodsTest
Test for behavior of proxies with inherited magic methods

Namespace

Doctrine\Tests\Common\Proxy

Code

public function testClonesPrivateProperties() {
  $proxyClassName = $this
    ->generateProxyClass(__NAMESPACE__ . '\\SerializedClass');

  /* @var $proxy SerializedClass */
  $proxy = new $proxyClassName();
  $proxy
    ->setFoo(1);
  $proxy
    ->setBar(2);
  $proxy
    ->setBaz(3);
  $unserialized = unserialize(serialize($proxy));
  $this
    ->assertSame(1, $unserialized
    ->getFoo());
  $this
    ->assertSame(2, $unserialized
    ->getBar());
  $this
    ->assertSame(3, $unserialized
    ->getBaz());
}