You are here

public function InstantiatorTest::testInstancesAreNotCloned in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php \DoctrineTest\InstantiatorTest\InstantiatorTest::testInstancesAreNotCloned()

File

vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php, line 142

Class

InstantiatorTest
Tests for { @author Marco Pivetta <ocramius@gmail.com>

Namespace

DoctrineTest\InstantiatorTest

Code

public function testInstancesAreNotCloned() {
  $className = 'TemporaryClass' . uniqid();
  eval('namespace ' . __NAMESPACE__ . '; class ' . $className . '{}');
  $instance = $this->instantiator
    ->instantiate(__NAMESPACE__ . '\\' . $className);
  $instance->foo = 'bar';
  $instance2 = $this->instantiator
    ->instantiate(__NAMESPACE__ . '\\' . $className);
  $this
    ->assertObjectNotHasAttribute('foo', $instance2);
}