You are here

public function ProxyMagicMethodsTest::testInheritedMagicClone in Plug 7

File

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