You are here

public function ProxyClassGeneratorTest::testUseEvalIfNoFilenameIsGiven in Plug 7

File

lib/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php, line 220

Class

ProxyClassGeneratorTest
Test the proxy generator. Its work is generating on-the-fly subclasses of a given model, which implement the Proxy pattern.

Namespace

Doctrine\Tests\Common\Proxy

Code

public function testUseEvalIfNoFilenameIsGiven() {
  $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true);
  $className = __NAMESPACE__ . '\\EvalBase';
  $metadata = $this
    ->createClassMetadata($className, array(
    'id',
  ));
  $proxyGenerator
    ->generateProxyClass($metadata);
  $reflClass = new ReflectionClass('Doctrine\\Tests\\Common\\ProxyProxy\\__CG__\\Doctrine\\Tests\\Common\\Proxy\\EvalBase');
  $this
    ->assertContains("eval()'d code", $reflClass
    ->getFileName());
}