You are here

public function ProxyMagicMethodsTest::testInheritedMagicClone in Zircon Profile 8.0

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

File

vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php, line 216

Class

ProxyMagicMethodsTest
Test for behavior of proxies with inherited magic methods

Namespace

Doctrine\Tests\Common\Proxy

Code

public function testInheritedMagicClone() {
  $proxyClassName = $this
    ->generateProxyClass(__NAMESPACE__ . '\\MagicCloneClass');
  $proxy = new $proxyClassName(null, function ($proxy) {
    $proxy->cloned = true;
  });
  $cloned = clone $proxy;
  $this
    ->assertSame('newClonedValue', $cloned->clonedValue);
  $this
    ->assertFalse($proxy->cloned);
  $this
    ->assertTrue($cloned->cloned);
}