You are here

public function ProxyMagicMethodsTest::testClonesPrivateProperties in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php \Doctrine\Tests\Common\Proxy\ProxyMagicMethodsTest::testClonesPrivateProperties()

@group DCOM-175

File

vendor/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());
}