public function AbstractProxyFactoryTest::testGenerateProxyClasses in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php \Doctrine\Tests\Common\Proxy\AbstractProxyFactoryTest::testGenerateProxyClasses()
File
- vendor/
doctrine/ common/ tests/ Doctrine/ Tests/ Common/ Proxy/ AbstractProxyFactoryTest.php, line 10
Class
Namespace
Doctrine\Tests\Common\ProxyCode
public function testGenerateProxyClasses() {
$metadata = $this
->getMock('Doctrine\\Common\\Persistence\\Mapping\\ClassMetadata');
$proxyGenerator = $this
->getMock('Doctrine\\Common\\Proxy\\ProxyGenerator', array(), array(), '', false);
$proxyGenerator
->expects($this
->once())
->method('getProxyFileName');
$proxyGenerator
->expects($this
->once())
->method('generateProxyClass');
$metadataFactory = $this
->getMock('Doctrine\\Common\\Persistence\\Mapping\\ClassMetadataFactory');
$proxyFactory = $this
->getMockForAbstractClass('Doctrine\\Common\\Proxy\\AbstractProxyFactory', array(
$proxyGenerator,
$metadataFactory,
true,
));
$proxyFactory
->expects($this
->any())
->method('skipClass')
->will($this
->returnValue(false));
$generated = $proxyFactory
->generateProxyClasses(array(
$metadata,
), sys_get_temp_dir());
$this
->assertEquals(1, $generated, 'One proxy was generated');
}