* @license MIT * * @covers \ProxyManager\ProxyGenerator\AccessInterceptorScopeLocalizerGenerator * @group Coverage */ class AccessInterceptorScopeLocalizerTest extends AbstractProxyGeneratorTest { /** * @dataProvider getTestedImplementations * * {@inheritDoc} */ public function testGeneratesValidCode($className) { $reflectionClass = new ReflectionClass($className); if ($reflectionClass->isInterface()) { // @todo interfaces *may* be proxied by deferring property localization to the constructor (no hardcoding) $this->setExpectedException('ProxyManager\Exception\InvalidProxiedClassException'); return parent::testGeneratesValidCode($className); } if ((! method_exists('Closure', 'bind')) && $reflectionClass->getProperties(ReflectionProperty::IS_PRIVATE) ) { $this->setExpectedException('ProxyManager\Exception\UnsupportedProxiedClassException'); } return parent::testGeneratesValidCode($className); } /** * {@inheritDoc} */ protected function getProxyGenerator() { return new AccessInterceptorScopeLocalizerGenerator(); } /** * {@inheritDoc} */ protected function getExpectedImplementedInterfaces() { return array('ProxyManager\\Proxy\\AccessInterceptorInterface'); } }