You are here

public function ProxyClassGeneratorTest::testClassWithInvalidTypeHintOnProxiedMethod in Plug 7

File

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

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 testClassWithInvalidTypeHintOnProxiedMethod() {
  $className = 'Doctrine\\Tests\\Common\\Proxy\\InvalidTypeHintClass';
  $metadata = $this
    ->createClassMetadata($className, array(
    'id',
  ));
  $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true);
  $this
    ->setExpectedException('Doctrine\\Common\\Proxy\\Exception\\UnexpectedValueException', 'The type hint of parameter "foo" in method "invalidTypeHintMethod"' . ' in class "' . $className . '" is invalid.');
  $proxyGenerator
    ->generateProxyClass($metadata);
}