diff --git a/src/ProxyManager/Factory/LazyLoadingGhostFactory.php b/src/ProxyManager/Factory/LazyLoadingGhostFactory.php index 73e030c78..294fb15a3 100644 --- a/src/ProxyManager/Factory/LazyLoadingGhostFactory.php +++ b/src/ProxyManager/Factory/LazyLoadingGhostFactory.php @@ -18,6 +18,7 @@ namespace ProxyManager\Factory; +use ProxyManager\Proxy\GhostObjectInterface; use ProxyManager\ProxyGenerator\LazyLoadingGhostGenerator; /** @@ -26,7 +27,7 @@ * @author Marco Pivetta * @license MIT * - * @method \ProxyManager\Proxy\GhostObjectInterface createProxy($className, \Closure $initializer) + * @method GhostObjectInterface createProxy($className, \Closure $initializer) */ class LazyLoadingGhostFactory extends AbstractLazyFactory { diff --git a/src/ProxyManager/Factory/LazyLoadingValueHolderFactory.php b/src/ProxyManager/Factory/LazyLoadingValueHolderFactory.php index c1449be73..8bd1f5ede 100644 --- a/src/ProxyManager/Factory/LazyLoadingValueHolderFactory.php +++ b/src/ProxyManager/Factory/LazyLoadingValueHolderFactory.php @@ -18,6 +18,7 @@ namespace ProxyManager\Factory; +use ProxyManager\Proxy\VirtualProxyInterface; use ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerator; /** @@ -26,7 +27,7 @@ * @author Marco Pivetta * @license MIT * - * @method \ProxyManager\Proxy\VirtualProxyInterface createProxy($className, \Closure $initializer) + * @method VirtualProxyInterface createProxy($className, \Closure $initializer) */ class LazyLoadingValueHolderFactory extends AbstractLazyFactory { diff --git a/tests/ProxyManagerTest/Factory/RemoteObject/Adapter/JsonRpcTest.php b/tests/ProxyManagerTest/Factory/RemoteObject/Adapter/JsonRpcTest.php index 1c7955c31..e72b1286f 100644 --- a/tests/ProxyManagerTest/Factory/RemoteObject/Adapter/JsonRpcTest.php +++ b/tests/ProxyManagerTest/Factory/RemoteObject/Adapter/JsonRpcTest.php @@ -20,6 +20,7 @@ use PHPUnit_Framework_TestCase; use ProxyManager\Factory\RemoteObject\Adapter\JsonRpc; +use Zend\Server\Client; /** * Tests for {@see \ProxyManager\Factory\RemoteObject\Adapter\JsonRpc} @@ -39,10 +40,8 @@ class JsonRpcTest extends PHPUnit_Framework_TestCase */ public function testCanBuildAdapterWithJsonRpcClient() { - $client = $this - ->getMockBuilder('Zend\Server\Client') - ->setMethods(['call']) - ->getMock(); + /* @var $client Client|\PHPUnit_Framework_MockObject_MockObject */ + $client = $this->getMock(Client::class, ['call']); $adapter = new JsonRpc($client); diff --git a/tests/ProxyManagerTest/Factory/RemoteObject/Adapter/SoapTest.php b/tests/ProxyManagerTest/Factory/RemoteObject/Adapter/SoapTest.php index 37a6744b1..c3d2bf507 100644 --- a/tests/ProxyManagerTest/Factory/RemoteObject/Adapter/SoapTest.php +++ b/tests/ProxyManagerTest/Factory/RemoteObject/Adapter/SoapTest.php @@ -20,6 +20,7 @@ use PHPUnit_Framework_TestCase; use ProxyManager\Factory\RemoteObject\Adapter\Soap; +use Zend\Server\Client; /** * Tests for {@see \ProxyManager\Factory\RemoteObject\Adapter\Soap} @@ -39,10 +40,8 @@ class SoapTest extends PHPUnit_Framework_TestCase */ public function testCanBuildAdapterWithSoapRpcClient() { - $client = $this - ->getMockBuilder('Zend\Server\Client') - ->setMethods(['call']) - ->getMock(); + /* @var $client Client|\PHPUnit_Framework_MockObject_MockObject */ + $client = $this->getMock(Client::class, ['call']); $adapter = new Soap($client); diff --git a/tests/ProxyManagerTest/Factory/RemoteObject/Adapter/XmlRpcTest.php b/tests/ProxyManagerTest/Factory/RemoteObject/Adapter/XmlRpcTest.php index a9db7d1ed..be32d555a 100644 --- a/tests/ProxyManagerTest/Factory/RemoteObject/Adapter/XmlRpcTest.php +++ b/tests/ProxyManagerTest/Factory/RemoteObject/Adapter/XmlRpcTest.php @@ -20,6 +20,7 @@ use PHPUnit_Framework_TestCase; use ProxyManager\Factory\RemoteObject\Adapter\XmlRpc; +use Zend\Server\Client; /** * Tests for {@see \ProxyManager\Factory\RemoteObject\Adapter\XmlRpc} @@ -39,10 +40,8 @@ class XmlRpcTest extends PHPUnit_Framework_TestCase */ public function testCanBuildAdapterWithXmlRpcClient() { - $client = $this - ->getMockBuilder('Zend\Server\Client') - ->setMethods(['call']) - ->getMock(); + /* @var $client Client|\PHPUnit_Framework_MockObject_MockObject */ + $client = $this->getMock(Client::class, ['call']); $adapter = new XmlRpc($client); diff --git a/tests/ProxyManagerTest/Factory/RemoteObjectFactoryTest.php b/tests/ProxyManagerTest/Factory/RemoteObjectFactoryTest.php index 95f636615..fc4744942 100644 --- a/tests/ProxyManagerTest/Factory/RemoteObjectFactoryTest.php +++ b/tests/ProxyManagerTest/Factory/RemoteObjectFactoryTest.php @@ -21,9 +21,11 @@ use PHPUnit_Framework_TestCase; use ProxyManager\Autoloader\AutoloaderInterface; use ProxyManager\Configuration; +use ProxyManager\Factory\RemoteObject\AdapterInterface; use ProxyManager\Factory\RemoteObjectFactory; use ProxyManager\Generator\ClassGenerator; use ProxyManager\Generator\Util\UniqueIdentifierGenerator; +use ProxyManager\GeneratorStrategy\GeneratorStrategyInterface; use ProxyManager\Inflector\ClassNameInflectorInterface; use ProxyManager\Signature\ClassSignatureGeneratorInterface; use ProxyManager\Signature\SignatureCheckerInterface; @@ -105,7 +107,8 @@ public function testWillSkipAutoGeneration() ->with(BaseInterface::class) ->will($this->returnValue(RemoteObjectMock::class)); - $adapter = $this->getMock('ProxyManager\Factory\RemoteObject\AdapterInterface'); + /* @var $adapter AdapterInterface|\PHPUnit_Framework_MockObject_MockObject */ + $adapter = $this->getMock(AdapterInterface::class); $factory = new RemoteObjectFactory($adapter, $this->config); /* @var $proxy \stdClass */ $proxy = $factory->createProxy(BaseInterface::class, $adapter); @@ -125,7 +128,7 @@ public function testWillSkipAutoGeneration() public function testWillTryAutoGeneration() { $proxyClassName = UniqueIdentifierGenerator::getIdentifier('bar'); - $generator = $this->getMock('ProxyManager\GeneratorStrategy\\GeneratorStrategyInterface'); + $generator = $this->getMock(GeneratorStrategyInterface::class); $autoloader = $this->getMock(AutoloaderInterface::class); $this->config->expects($this->any())->method('getGeneratorStrategy')->will($this->returnValue($generator)); @@ -176,7 +179,8 @@ function () use ($proxyClassName) { $this->signatureChecker->expects($this->atLeastOnce())->method('checkSignature'); $this->classSignatureGenerator->expects($this->once())->method('addSignature')->will($this->returnArgument(0)); - $adapter = $this->getMock('ProxyManager\Factory\RemoteObject\AdapterInterface'); + /* @var $adapter AdapterInterface */ + $adapter = $this->getMock(AdapterInterface::class); $factory = new RemoteObjectFactory($adapter, $this->config); $proxy = $factory->createProxy(BaseInterface::class, $adapter); diff --git a/tests/ProxyManagerTest/Functional/AccessInterceptorScopeLocalizerFunctionalTest.php b/tests/ProxyManagerTest/Functional/AccessInterceptorScopeLocalizerFunctionalTest.php index 679605eb0..e7019524f 100644 --- a/tests/ProxyManagerTest/Functional/AccessInterceptorScopeLocalizerFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/AccessInterceptorScopeLocalizerFunctionalTest.php @@ -47,12 +47,18 @@ class AccessInterceptorScopeLocalizerFunctionalTest extends PHPUnit_Framework_Te { /** * @dataProvider getProxyMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ - public function testMethodCalls($className, $instance, $method, $params, $expectedValue) + public function testMethodCalls($className, $instance, $method, array $params, $expectedValue) { $proxyName = $this->generateProxy($className); - /* @var $proxy \ProxyManager\Proxy\AccessInterceptorInterface */ + /* @var $proxy AccessInterceptorInterface */ $proxy = $proxyName::staticProxyConstructor($instance); $this->assertProxySynchronized($instance, $proxy); @@ -91,12 +97,18 @@ function ($proxy, $instance, $method, $params, & $returnEarly) use ($random) { /** * @dataProvider getProxyMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ - public function testMethodCallsWithSuffixListener($className, $instance, $method, $params, $expectedValue) + public function testMethodCallsWithSuffixListener($className, $instance, $method, array $params, $expectedValue) { $proxyName = $this->generateProxy($className); - /* @var $proxy \ProxyManager\Proxy\AccessInterceptorInterface */ + /* @var $proxy AccessInterceptorInterface */ $proxy = $proxyName::staticProxyConstructor($instance); /* @var $listener callable|\PHPUnit_Framework_MockObject_MockObject */ $listener = $this->getMock(stdClass::class, ['__invoke']); @@ -131,11 +143,17 @@ function ($proxy, $instance, $method, $params, $returnValue, & $returnEarly) use /** * @dataProvider getProxyMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ - public function testMethodCallsAfterUnSerialization($className, $instance, $method, $params, $expectedValue) + public function testMethodCallsAfterUnSerialization($className, $instance, $method, array $params, $expectedValue) { $proxyName = $this->generateProxy($className); - /* @var $proxy \ProxyManager\Proxy\AccessInterceptorInterface */ + /* @var $proxy AccessInterceptorInterface */ $proxy = unserialize(serialize($proxyName::staticProxyConstructor($instance))); $this->assertSame($expectedValue, call_user_func_array([$proxy, $method], $params)); @@ -144,12 +162,18 @@ public function testMethodCallsAfterUnSerialization($className, $instance, $meth /** * @dataProvider getProxyMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ - public function testMethodCallsAfterCloning($className, $instance, $method, $params, $expectedValue) + public function testMethodCallsAfterCloning($className, $instance, $method, array $params, $expectedValue) { $proxyName = $this->generateProxy($className); - /* @var $proxy \ProxyManager\Proxy\AccessInterceptorInterface */ + /* @var $proxy AccessInterceptorInterface */ $proxy = $proxyName::staticProxyConstructor($instance); $cloned = clone $proxy; @@ -160,20 +184,31 @@ public function testMethodCallsAfterCloning($className, $instance, $method, $par /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param AccessInterceptorInterface $proxy + * @param string $publicProperty + * @param mixed $propertyValue */ - public function testPropertyReadAccess($instance, $proxy, $publicProperty, $propertyValue) - { - /* @var $proxy \ProxyManager\Proxy\AccessInterceptorInterface */ + public function testPropertyReadAccess( + $instance, + AccessInterceptorInterface $proxy, + $publicProperty, + $propertyValue + ) { $this->assertSame($propertyValue, $proxy->$publicProperty); $this->assertProxySynchronized($instance, $proxy); } /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param AccessInterceptorInterface $proxy + * @param string $publicProperty */ - public function testPropertyWriteAccess($instance, $proxy, $publicProperty) + public function testPropertyWriteAccess($instance, AccessInterceptorInterface $proxy, $publicProperty) { - /* @var $proxy \ProxyManager\Proxy\AccessInterceptorInterface */ $newValue = uniqid(); $proxy->$publicProperty = $newValue; @@ -183,10 +218,13 @@ public function testPropertyWriteAccess($instance, $proxy, $publicProperty) /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param AccessInterceptorInterface $proxy + * @param string $publicProperty */ - public function testPropertyExistence($instance, $proxy, $publicProperty) + public function testPropertyExistence($instance, AccessInterceptorInterface $proxy, $publicProperty) { - /* @var $proxy \ProxyManager\Proxy\AccessInterceptorInterface */ $this->assertSame(isset($instance->$publicProperty), isset($proxy->$publicProperty)); $this->assertProxySynchronized($instance, $proxy); @@ -197,11 +235,14 @@ public function testPropertyExistence($instance, $proxy, $publicProperty) /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param AccessInterceptorInterface $proxy + * @param string $publicProperty */ - public function testPropertyUnset($instance, $proxy, $publicProperty) + public function testPropertyUnset($instance, AccessInterceptorInterface $proxy, $publicProperty) { $this->markTestSkipped('It is currently not possible to synchronize properties un-setting'); - /* @var $proxy \ProxyManager\Proxy\AccessInterceptorInterface */ unset($proxy->$publicProperty); $this->assertFalse(isset($instance->$publicProperty)); @@ -217,7 +258,7 @@ public function testCanWriteToArrayKeysInPublicProperty() $instance = new ClassWithPublicArrayProperty(); $className = get_class($instance); $proxyName = $this->generateProxy($className); - /* @var $proxy ClassWithPublicArrayProperty */ + /* @var $proxy ClassWithPublicArrayProperty|AccessInterceptorInterface */ $proxy = $proxyName::staticProxyConstructor($instance); $proxy->arrayProperty['foo'] = 'bar'; @@ -238,7 +279,7 @@ public function testWillNotModifyRetrievedPublicProperties() $instance = new ClassWithPublicProperties(); $className = get_class($instance); $proxyName = $this->generateProxy($className); - /* @var $proxy ClassWithPublicProperties||AccessInterceptorInterface */ + /* @var $proxy ClassWithPublicProperties|AccessInterceptorInterface */ $proxy = $proxyName::staticProxyConstructor($instance); $variable = $proxy->property0; diff --git a/tests/ProxyManagerTest/Functional/AccessInterceptorValueHolderFunctionalTest.php b/tests/ProxyManagerTest/Functional/AccessInterceptorValueHolderFunctionalTest.php index 698f3b27a..ed6cf99f6 100644 --- a/tests/ProxyManagerTest/Functional/AccessInterceptorValueHolderFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/AccessInterceptorValueHolderFunctionalTest.php @@ -45,6 +45,12 @@ class AccessInterceptorValueHolderFunctionalTest extends PHPUnit_Framework_TestC { /** * @dataProvider getProxyMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ public function testMethodCalls($className, $instance, $method, $params, $expectedValue) { @@ -88,6 +94,12 @@ function ($proxy, $instance, $method, $params, & $returnEarly) use ($random) { /** * @dataProvider getProxyMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ public function testMethodCallsWithSuffixListener($className, $instance, $method, $params, $expectedValue) { @@ -127,6 +139,12 @@ function ($proxy, $instance, $method, $params, $returnValue, & $returnEarly) use /** * @dataProvider getProxyMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ public function testMethodCallsAfterUnSerialization($className, $instance, $method, $params, $expectedValue) { @@ -140,6 +158,12 @@ public function testMethodCallsAfterUnSerialization($className, $instance, $meth /** * @dataProvider getProxyMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ public function testMethodCallsAfterCloning($className, $instance, $method, $params, $expectedValue) { @@ -156,20 +180,27 @@ public function testMethodCallsAfterCloning($className, $instance, $method, $par /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param \ProxyManager\Proxy\AccessInterceptorInterface|\ProxyManager\Proxy\ValueHolderInterface $proxy + * @param string $publicProperty + * @param mixed $propertyValue */ public function testPropertyReadAccess($instance, $proxy, $publicProperty, $propertyValue) { - /* @var $proxy \ProxyManager\Proxy\AccessInterceptorInterface|\ProxyManager\Proxy\ValueHolderInterface */ $this->assertSame($propertyValue, $proxy->$publicProperty); $this->assertEquals($instance, $proxy->getWrappedValueHolderValue()); } /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param \ProxyManager\Proxy\AccessInterceptorInterface|\ProxyManager\Proxy\ValueHolderInterface $proxy + * @param string $publicProperty */ public function testPropertyWriteAccess($instance, $proxy, $publicProperty) { - /* @var $proxy \ProxyManager\Proxy\AccessInterceptorInterface|\ProxyManager\Proxy\ValueHolderInterface */ $newValue = uniqid(); $proxy->$publicProperty = $newValue; @@ -179,10 +210,13 @@ public function testPropertyWriteAccess($instance, $proxy, $publicProperty) /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param \ProxyManager\Proxy\AccessInterceptorInterface|\ProxyManager\Proxy\ValueHolderInterface $proxy + * @param string $publicProperty */ public function testPropertyExistence($instance, $proxy, $publicProperty) { - /* @var $proxy \ProxyManager\Proxy\AccessInterceptorInterface|\ProxyManager\Proxy\ValueHolderInterface */ $this->assertSame(isset($instance->$publicProperty), isset($proxy->$publicProperty)); $this->assertEquals($instance, $proxy->getWrappedValueHolderValue()); @@ -192,10 +226,13 @@ public function testPropertyExistence($instance, $proxy, $publicProperty) /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param \ProxyManager\Proxy\AccessInterceptorInterface|\ProxyManager\Proxy\ValueHolderInterface $proxy + * @param string $publicProperty */ public function testPropertyUnset($instance, $proxy, $publicProperty) { - /* @var $proxy \ProxyManager\Proxy\AccessInterceptorInterface|\ProxyManager\Proxy\ValueHolderInterface */ $instance = $proxy->getWrappedValueHolderValue() ? $proxy->getWrappedValueHolderValue() : $instance; unset($proxy->$publicProperty); diff --git a/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php b/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php index d156e7ff2..c5d0a799f 100644 --- a/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php @@ -52,12 +52,18 @@ class LazyLoadingGhostFunctionalTest extends PHPUnit_Framework_TestCase { /** * @dataProvider getProxyInitializingMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ - public function testMethodCallsThatLazyLoadTheObject($className, $instance, $method, $params, $expectedValue) + public function testMethodCallsThatLazyLoadTheObject($className, $instance, $method, array $params, $expectedValue) { $proxyName = $this->generateProxy($className); - /* @var $proxy GhostObjectInterface|BaseClass */ + /* @var $proxy GhostObjectInterface */ $proxy = $proxyName::staticProxyConstructor($this->createInitializer($className, $instance)); $this->assertFalse($proxy->isProxyInitialized()); @@ -67,15 +73,26 @@ public function testMethodCallsThatLazyLoadTheObject($className, $instance, $met /** * @dataProvider getProxyNonInitializingMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ - public function testMethodCallsThatDoNotLazyLoadTheObject($className, $instance, $method, $params, $expectedValue) - { + public function testMethodCallsThatDoNotLazyLoadTheObject( + $className, + $instance, + $method, + array $params, + $expectedValue + ) { $proxyName = $this->generateProxy($className); $initializeMatcher = $this->getMock('stdClass', ['__invoke']); $initializeMatcher->expects($this->never())->method('__invoke'); // should not initialize the proxy - /* @var $proxy \ProxyManager\Proxy\GhostObjectInterface|BaseClass */ + /* @var $proxy GhostObjectInterface */ $proxy = $proxyName::staticProxyConstructor( $this->createInitializer($className, $instance, $initializeMatcher) ); @@ -87,12 +104,18 @@ public function testMethodCallsThatDoNotLazyLoadTheObject($className, $instance, /** * @dataProvider getProxyMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ - public function testMethodCallsAfterUnSerialization($className, $instance, $method, $params, $expectedValue) + public function testMethodCallsAfterUnSerialization($className, $instance, $method, array $params, $expectedValue) { $proxyName = $this->generateProxy($className); - /* @var $proxy GhostObjectInterface|BaseClass */ + /* @var $proxy GhostObjectInterface */ $proxy = unserialize(serialize($proxyName::staticProxyConstructor( $this->createInitializer($className, $instance) ))); @@ -103,12 +126,18 @@ public function testMethodCallsAfterUnSerialization($className, $instance, $meth /** * @dataProvider getProxyMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ - public function testMethodCallsAfterCloning($className, $instance, $method, $params, $expectedValue) + public function testMethodCallsAfterCloning($className, $instance, $method, array $params, $expectedValue) { $proxyName = $this->generateProxy($className); - /* @var $proxy GhostObjectInterface|BaseClass */ + /* @var $proxy GhostObjectInterface */ $proxy = $proxyName::staticProxyConstructor($this->createInitializer($className, $instance)); $cloned = clone $proxy; @@ -118,20 +147,27 @@ public function testMethodCallsAfterCloning($className, $instance, $method, $par /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param GhostObjectInterface $proxy + * @param string $publicProperty + * @param mixed $propertyValue */ - public function testPropertyReadAccess($instance, $proxy, $publicProperty, $propertyValue) + public function testPropertyReadAccess($instance, GhostObjectInterface $proxy, $publicProperty, $propertyValue) { - /* @var $proxy GhostObjectInterface */ $this->assertSame($propertyValue, $proxy->$publicProperty); $this->assertTrue($proxy->isProxyInitialized()); } /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param GhostObjectInterface $proxy + * @param string $publicProperty */ - public function testPropertyWriteAccess($instance, $proxy, $publicProperty) + public function testPropertyWriteAccess($instance, GhostObjectInterface $proxy, $publicProperty) { - /* @var $proxy GhostObjectInterface */ $newValue = uniqid(); $proxy->$publicProperty = $newValue; @@ -141,20 +177,26 @@ public function testPropertyWriteAccess($instance, $proxy, $publicProperty) /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param GhostObjectInterface $proxy + * @param string $publicProperty */ - public function testPropertyExistence($instance, $proxy, $publicProperty) + public function testPropertyExistence($instance, GhostObjectInterface $proxy, $publicProperty) { - /* @var $proxy GhostObjectInterface */ $this->assertSame(isset($instance->$publicProperty), isset($proxy->$publicProperty)); $this->assertTrue($proxy->isProxyInitialized()); } /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param GhostObjectInterface $proxy + * @param string $publicProperty */ - public function testPropertyAbsence($instance, $proxy, $publicProperty) + public function testPropertyAbsence($instance, GhostObjectInterface $proxy, $publicProperty) { - /* @var $proxy GhostObjectInterface */ $proxy->$publicProperty = null; $this->assertFalse(isset($proxy->$publicProperty)); $this->assertTrue($proxy->isProxyInitialized()); @@ -162,11 +204,13 @@ public function testPropertyAbsence($instance, $proxy, $publicProperty) /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param GhostObjectInterface $proxy + * @param string $publicProperty */ - public function testPropertyUnset($instance, $proxy, $publicProperty) + public function testPropertyUnset($instance, GhostObjectInterface $proxy, $publicProperty) { - /* @var $proxy GhostObjectInterface */ - unset($proxy->$publicProperty); $this->assertTrue($proxy->isProxyInitialized()); diff --git a/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php b/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php index 7b19225f3..2f21995e0 100644 --- a/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php @@ -47,12 +47,18 @@ class LazyLoadingValueHolderFunctionalTest extends PHPUnit_Framework_TestCase { /** * @dataProvider getProxyMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ - public function testMethodCalls($className, $instance, $method, $params, $expectedValue) + public function testMethodCalls($className, $instance, $method, array $params, $expectedValue) { $proxyName = $this->generateProxy($className); - /* @var $proxy VirtualProxyInterface|BaseClass */ + /* @var $proxy VirtualProxyInterface */ $proxy = $proxyName::staticProxyConstructor($this->createInitializer($className, $instance)); $this->assertFalse($proxy->isProxyInitialized()); @@ -63,12 +69,18 @@ public function testMethodCalls($className, $instance, $method, $params, $expect /** * @dataProvider getProxyMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ - public function testMethodCallsAfterUnSerialization($className, $instance, $method, $params, $expectedValue) + public function testMethodCallsAfterUnSerialization($className, $instance, $method, array $params, $expectedValue) { $proxyName = $this->generateProxy($className); - /* @var $proxy VirtualProxyInterface|BaseClass */ + /* @var $proxy VirtualProxyInterface */ $proxy = unserialize(serialize($proxyName::staticProxyConstructor( $this->createInitializer($className, $instance) ))); @@ -80,12 +92,18 @@ public function testMethodCallsAfterUnSerialization($className, $instance, $meth /** * @dataProvider getProxyMethods + * + * @param string $className + * @param object $instance + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ - public function testMethodCallsAfterCloning($className, $instance, $method, $params, $expectedValue) + public function testMethodCallsAfterCloning($className, $instance, $method, array $params, $expectedValue) { $proxyName = $this->generateProxy($className); - /* @var $proxy VirtualProxyInterface|BaseClass */ + /* @var $proxy VirtualProxyInterface */ $proxy = $proxyName::staticProxyConstructor($this->createInitializer($className, $instance)); $cloned = clone $proxy; @@ -97,10 +115,14 @@ public function testMethodCallsAfterCloning($className, $instance, $method, $par /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param VirtualProxyInterface $proxy + * @param string $publicProperty + * @param mixed $propertyValue */ - public function testPropertyReadAccess($instance, $proxy, $publicProperty, $propertyValue) + public function testPropertyReadAccess($instance, VirtualProxyInterface $proxy, $publicProperty, $propertyValue) { - /* @var $proxy VirtualProxyInterface|BaseClass */ $this->assertSame($propertyValue, $proxy->$publicProperty); $this->assertTrue($proxy->isProxyInitialized()); $this->assertEquals($instance, $proxy->getWrappedValueHolderValue()); @@ -108,10 +130,13 @@ public function testPropertyReadAccess($instance, $proxy, $publicProperty, $prop /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param VirtualProxyInterface $proxy + * @param string $publicProperty */ - public function testPropertyWriteAccess($instance, $proxy, $publicProperty) + public function testPropertyWriteAccess($instance, VirtualProxyInterface $proxy, $publicProperty) { - /* @var $proxy VirtualProxyInterface|BaseClass */ $newValue = uniqid(); $proxy->$publicProperty = $newValue; @@ -122,10 +147,13 @@ public function testPropertyWriteAccess($instance, $proxy, $publicProperty) /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param VirtualProxyInterface $proxy + * @param string $publicProperty */ - public function testPropertyExistence($instance, $proxy, $publicProperty) + public function testPropertyExistence($instance, VirtualProxyInterface $proxy, $publicProperty) { - /* @var $proxy VirtualProxyInterface|BaseClass */ $this->assertSame(isset($instance->$publicProperty), isset($proxy->$publicProperty)); $this->assertTrue($proxy->isProxyInitialized()); $this->assertEquals($instance, $proxy->getWrappedValueHolderValue()); @@ -133,10 +161,13 @@ public function testPropertyExistence($instance, $proxy, $publicProperty) /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param VirtualProxyInterface $proxy + * @param string $publicProperty */ - public function testPropertyAbsence($instance, $proxy, $publicProperty) + public function testPropertyAbsence($instance, VirtualProxyInterface $proxy, $publicProperty) { - /* @var $proxy VirtualProxyInterface|BaseClass */ $instance = $proxy->getWrappedValueHolderValue() ? $proxy->getWrappedValueHolderValue() : $instance; $instance->$publicProperty = null; $this->assertFalse(isset($proxy->$publicProperty)); @@ -145,10 +176,13 @@ public function testPropertyAbsence($instance, $proxy, $publicProperty) /** * @dataProvider getPropertyAccessProxies + * + * @param object $instance + * @param VirtualProxyInterface $proxy + * @param string $publicProperty */ - public function testPropertyUnset($instance, $proxy, $publicProperty) + public function testPropertyUnset($instance, VirtualProxyInterface $proxy, $publicProperty) { - /* @var $proxy VirtualProxyInterface|BaseClass */ $instance = $proxy->getWrappedValueHolderValue() ? $proxy->getWrappedValueHolderValue() : $instance; unset($proxy->$publicProperty); diff --git a/tests/ProxyManagerTest/Functional/MultipleProxyGenerationTest.php b/tests/ProxyManagerTest/Functional/MultipleProxyGenerationTest.php index 047685239..742eb99be 100644 --- a/tests/ProxyManagerTest/Functional/MultipleProxyGenerationTest.php +++ b/tests/ProxyManagerTest/Functional/MultipleProxyGenerationTest.php @@ -60,6 +60,8 @@ class MultipleProxyGenerationTest extends PHPUnit_Framework_TestCase * and won't conflict * * @dataProvider getTestedClasses + * + * @param string $className */ public function testCanGenerateMultipleDifferentProxiesForSameClass($className) { diff --git a/tests/ProxyManagerTest/Functional/NullObjectFunctionalTest.php b/tests/ProxyManagerTest/Functional/NullObjectFunctionalTest.php index 78403cd75..05655adca 100644 --- a/tests/ProxyManagerTest/Functional/NullObjectFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/NullObjectFunctionalTest.php @@ -22,6 +22,7 @@ use ProxyManager\Generator\ClassGenerator; use ProxyManager\Generator\Util\UniqueIdentifierGenerator; use ProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy; +use ProxyManager\Proxy\NullObjectInterface; use ProxyManager\ProxyGenerator\NullObjectGenerator; use ProxyManagerTestAsset\BaseClass; use ProxyManagerTestAsset\BaseInterface; @@ -41,24 +42,32 @@ class NullObjectFunctionalTest extends PHPUnit_Framework_TestCase { /** * @dataProvider getProxyMethods + * + * @param string $className + * @param string $method + * @param mixed[] $params */ - public function testMethodCalls($className, $instance, $method, $params, $expectedValue) + public function testMethodCalls($className, $method, $params) { $proxyName = $this->generateProxy($className); - /* @var $proxy \ProxyManager\Proxy\NullObjectInterface */ - $proxy = $proxyName::staticProxyConstructor(); + /* @var $proxy NullObjectInterface */ + $proxy = $proxyName::staticProxyConstructor(); $this->assertSame(null, call_user_func_array([$proxy, $method], $params)); } /** * @dataProvider getProxyMethods + * + * @param string $className + * @param string $method + * @param mixed[] $params */ - public function testMethodCallsAfterUnSerialization($className, $instance, $method, $params, $expectedValue) + public function testMethodCallsAfterUnSerialization($className, $method, $params) { $proxyName = $this->generateProxy($className); - /* @var $proxy \ProxyManager\Proxy\NullObjectInterface */ + /* @var $proxy NullObjectInterface */ $proxy = unserialize(serialize($proxyName::staticProxyConstructor())); $this->assertSame(null, call_user_func_array([$proxy, $method], $params)); @@ -66,12 +75,16 @@ public function testMethodCallsAfterUnSerialization($className, $instance, $meth /** * @dataProvider getProxyMethods + * + * @param string $className + * @param string $method + * @param mixed[] $params */ - public function testMethodCallsAfterCloning($className, $instance, $method, $params, $expectedValue) + public function testMethodCallsAfterCloning($className, $method, $params) { $proxyName = $this->generateProxy($className); - /* @var $proxy \ProxyManager\Proxy\NullObjectInterface */ + /* @var $proxy NullObjectInterface */ $proxy = $proxyName::staticProxyConstructor(); $cloned = clone $proxy; @@ -80,19 +93,23 @@ public function testMethodCallsAfterCloning($className, $instance, $method, $par /** * @dataProvider getPropertyAccessProxies + * + * @param NullObjectInterface $proxy + * @param string $publicProperty */ - public function testPropertyReadAccess($instance, $proxy, $publicProperty, $propertyValue) + public function testPropertyReadAccess(NullObjectInterface $proxy, $publicProperty) { - /* @var $proxy \ProxyManager\Proxy\NullObjectInterface */ $this->assertSame(null, $proxy->$publicProperty); } /** * @dataProvider getPropertyAccessProxies + * + * @param NullObjectInterface $proxy + * @param string $publicProperty */ - public function testPropertyWriteAccess($instance, $proxy, $publicProperty) + public function testPropertyWriteAccess(NullObjectInterface $proxy, $publicProperty) { - /* @var $proxy \ProxyManager\Proxy\NullObjectInterface */ $newValue = uniqid(); $proxy->$publicProperty = $newValue; @@ -101,22 +118,25 @@ public function testPropertyWriteAccess($instance, $proxy, $publicProperty) /** * @dataProvider getPropertyAccessProxies + * + * @param NullObjectInterface $proxy + * @param string $publicProperty */ - public function testPropertyExistence($instance, $proxy, $publicProperty) + public function testPropertyExistence(NullObjectInterface $proxy, $publicProperty) { - /* @var $proxy \ProxyManager\Proxy\NullObjectInterface */ $this->assertSame(null, $proxy->$publicProperty); } /** * @dataProvider getPropertyAccessProxies + * + * @param NullObjectInterface $proxy + * @param string $publicProperty */ - public function testPropertyUnset($instance, $proxy, $publicProperty) + public function testPropertyUnset(NullObjectInterface $proxy, $publicProperty) { - /* @var $proxy \ProxyManager\Proxy\NullObjectInterface */ unset($proxy->$publicProperty); - $this->assertTrue(isset($instance->$publicProperty)); $this->assertFalse(isset($proxy->$publicProperty)); } @@ -152,35 +172,30 @@ public function getProxyMethods() return [ [ BaseClass::class, - new BaseClass(), 'publicMethod', [], 'publicMethodDefault' ], [ BaseClass::class, - new BaseClass(), 'publicTypeHintedMethod', ['param' => new \stdClass()], 'publicTypeHintedMethodDefault' ], [ BaseClass::class, - new BaseClass(), 'publicByReferenceMethod', [], 'publicByReferenceMethodDefault' ], [ BaseInterface::class, - new BaseClass(), 'publicMethod', [], 'publicMethodDefault' ], [ ClassWithSelfHint::class, - new ClassWithSelfHint(), 'selfHintMethod', ['parameter' => $selfHintParam], $selfHintParam @@ -195,21 +210,17 @@ public function getProxyMethods() */ public function getPropertyAccessProxies() { - $instance1 = new BaseClass(); - $proxyName1 = $this->generateProxy(get_class($instance1)); - $instance2 = new BaseClass(); - $proxyName2 = $this->generateProxy(get_class($instance2)); + $proxyName1 = $this->generateProxy(BaseClass::class); + $proxyName2 = $this->generateProxy(BaseClass::class); return [ [ - $instance1, - $proxyName1::staticProxyConstructor($instance1), + $proxyName1::staticProxyConstructor(), 'publicProperty', 'publicPropertyDefault', ], [ - $instance2, - unserialize(serialize($proxyName2::staticProxyConstructor($instance2))), + unserialize(serialize($proxyName2::staticProxyConstructor())), 'publicProperty', 'publicPropertyDefault', ], diff --git a/tests/ProxyManagerTest/Functional/RemoteObjectFunctionalTest.php b/tests/ProxyManagerTest/Functional/RemoteObjectFunctionalTest.php index 4c2c4af95..76466049a 100644 --- a/tests/ProxyManagerTest/Functional/RemoteObjectFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/RemoteObjectFunctionalTest.php @@ -28,6 +28,7 @@ use ProxyManagerTestAsset\ClassWithSelfHint; use ProxyManagerTestAsset\RemoteProxy\Foo; use ReflectionClass; +use Zend\Server\Client; /** * Tests for {@see \ProxyManager\ProxyGenerator\RemoteObjectGenerator} produced objects @@ -49,10 +50,8 @@ class RemoteObjectFunctionalTest extends PHPUnit_Framework_TestCase */ protected function getXmlRpcAdapter($expectedValue, $method, array $params) { - $client = $this - ->getMockBuilder('Zend\Server\Client') - ->setMethods(['call']) - ->getMock(); + /* @var $client Client|\PHPUnit_Framework_MockObject_MockObject */ + $client = $this->getMock(Client::class, ['call']); $client ->expects($this->any()) @@ -80,10 +79,8 @@ protected function getXmlRpcAdapter($expectedValue, $method, array $params) */ protected function getJsonRpcAdapter($expectedValue, $method, array $params) { - $client = $this - ->getMockBuilder('Zend\Server\Client') - ->setMethods(['call']) - ->getMock(); + /* @var $client Client|\PHPUnit_Framework_MockObject_MockObject */ + $client = $this->getMock(Client::class, ['call']); $client ->expects($this->any()) @@ -104,10 +101,15 @@ protected function getJsonRpcAdapter($expectedValue, $method, array $params) /** * @dataProvider getProxyMethods + * + * @param string|object $instanceOrClassName + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ - public function testXmlRpcMethodCalls($instanceOrClassname, $method, $params, $expectedValue) + public function testXmlRpcMethodCalls($instanceOrClassName, $method, array $params, $expectedValue) { - $proxyName = $this->generateProxy($instanceOrClassname); + $proxyName = $this->generateProxy($instanceOrClassName); /* @var $proxy \ProxyManager\Proxy\RemoteObjectInterface */ $proxy = $proxyName::staticProxyConstructor($this->getXmlRpcAdapter($expectedValue, $method, $params)); @@ -117,10 +119,15 @@ public function testXmlRpcMethodCalls($instanceOrClassname, $method, $params, $e /** * @dataProvider getProxyMethods + * + * @param string|object $instanceOrClassName + * @param string $method + * @param mixed[] $params + * @param mixed $expectedValue */ - public function testJsonRpcMethodCalls($instanceOrClassname, $method, $params, $expectedValue) + public function testJsonRpcMethodCalls($instanceOrClassName, $method, array $params, $expectedValue) { - $proxyName = $this->generateProxy($instanceOrClassname); + $proxyName = $this->generateProxy($instanceOrClassName); /* @var $proxy \ProxyManager\Proxy\RemoteObjectInterface */ $proxy = $proxyName::staticProxyConstructor($this->getJsonRpcAdapter($expectedValue, $method, $params)); @@ -130,10 +137,14 @@ public function testJsonRpcMethodCalls($instanceOrClassname, $method, $params, $ /** * @dataProvider getPropertyAccessProxies + * + * @param string|object $instanceOrClassName + * @param string $publicProperty + * @param string $propertyValue */ - public function testJsonRpcPropertyReadAccess($instanceOrClassname, $publicProperty, $propertyValue) + public function testJsonRpcPropertyReadAccess($instanceOrClassName, $publicProperty, $propertyValue) { - $proxyName = $this->generateProxy($instanceOrClassname); + $proxyName = $this->generateProxy($instanceOrClassName); /* @var $proxy \ProxyManager\Proxy\RemoteObjectInterface */ $proxy = $proxyName::staticProxyConstructor( diff --git a/tests/ProxyManagerTest/Generator/Util/ClassGeneratorUtilsTest.php b/tests/ProxyManagerTest/Generator/Util/ClassGeneratorUtilsTest.php index 22bed857c..6983e3c8a 100644 --- a/tests/ProxyManagerTest/Generator/Util/ClassGeneratorUtilsTest.php +++ b/tests/ProxyManagerTest/Generator/Util/ClassGeneratorUtilsTest.php @@ -40,7 +40,9 @@ class ClassGeneratorUtilsTest extends PHPUnit_Framework_TestCase { public function testCantAddAFinalMethod() { + /* @var $classGenerator ClassGenerator|\PHPUnit_Framework_MockObject_MockObject */ $classGenerator = $this->getMock(ClassGenerator::class); + /* @var $methodGenerator MethodGenerator|\PHPUnit_Framework_MockObject_MockObject */ $methodGenerator = $this->getMock(MethodGenerator::class); $methodGenerator @@ -59,7 +61,9 @@ public function testCantAddAFinalMethod() public function testCanAddANotFinalMethod() { + /* @var $classGenerator ClassGenerator|\PHPUnit_Framework_MockObject_MockObject */ $classGenerator = $this->getMock(ClassGenerator::class); + /* @var $methodGenerator MethodGenerator|\PHPUnit_Framework_MockObject_MockObject */ $methodGenerator = $this->getMock(MethodGenerator::class); $methodGenerator diff --git a/tests/ProxyManagerTest/Generator/Util/UniqueIdentifierGeneratorTest.php b/tests/ProxyManagerTest/Generator/Util/UniqueIdentifierGeneratorTest.php index c37e1fbb6..45bfff6d8 100644 --- a/tests/ProxyManagerTest/Generator/Util/UniqueIdentifierGeneratorTest.php +++ b/tests/ProxyManagerTest/Generator/Util/UniqueIdentifierGeneratorTest.php @@ -35,6 +35,8 @@ class UniqueIdentifierGeneratorTest extends PHPUnit_Framework_TestCase * @dataProvider getBaseIdentifierNames * * @covers \ProxyManager\Generator\Util\UniqueIdentifierGenerator::getIdentifier + * + * @param string $name */ public function testGeneratesUniqueIdentifiers($name) { @@ -48,6 +50,8 @@ public function testGeneratesUniqueIdentifiers($name) * @dataProvider getBaseIdentifierNames * * @covers \ProxyManager\Generator\Util\UniqueIdentifierGenerator::getIdentifier + * + * @param string $name */ public function testGeneratesValidIdentifiers($name) { diff --git a/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php b/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php index 05010ba4e..44c948d1b 100644 --- a/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php +++ b/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php @@ -40,6 +40,7 @@ class FileWriterGeneratorStrategyTest extends PHPUnit_Framework_TestCase */ public function testGenerate() { + /* @var $locator FileLocatorInterface|\PHPUnit_Framework_MockObject_MockObject */ $locator = $this->getMock(FileLocatorInterface::class); $generator = new FileWriterGeneratorStrategy($locator); $tmpFile = sys_get_temp_dir() . '/FileWriterGeneratorStrategyTest' . uniqid() . '.php'; diff --git a/tests/ProxyManagerTest/Inflector/ClassNameInflectorTest.php b/tests/ProxyManagerTest/Inflector/ClassNameInflectorTest.php index f4ee6d35e..87f53d682 100644 --- a/tests/ProxyManagerTest/Inflector/ClassNameInflectorTest.php +++ b/tests/ProxyManagerTest/Inflector/ClassNameInflectorTest.php @@ -39,6 +39,9 @@ class ClassNameInflectorTest extends PHPUnit_Framework_TestCase * @covers \ProxyManager\Inflector\ClassNameInflector::getUserClassName * @covers \ProxyManager\Inflector\ClassNameInflector::getProxyClassName * @covers \ProxyManager\Inflector\ClassNameInflector::isProxyClassName + * + * @param string $realClassName + * @param string $proxyClassName */ public function testInflector($realClassName, $proxyClassName) { diff --git a/tests/ProxyManagerTest/Inflector/Util/ParameterEncoderTest.php b/tests/ProxyManagerTest/Inflector/Util/ParameterEncoderTest.php index 50be98917..ee8fbf89c 100644 --- a/tests/ProxyManagerTest/Inflector/Util/ParameterEncoderTest.php +++ b/tests/ProxyManagerTest/Inflector/Util/ParameterEncoderTest.php @@ -35,6 +35,8 @@ class ParameterEncoderTest extends PHPUnit_Framework_TestCase * @dataProvider getParameters * * @covers \ProxyManager\Inflector\Util\ParameterEncoder::encodeParameters + * + * @param mixed[] $parameters */ public function testGeneratesValidClassName(array $parameters) { diff --git a/tests/ProxyManagerTest/Inflector/Util/ParameterHasherTest.php b/tests/ProxyManagerTest/Inflector/Util/ParameterHasherTest.php index 23a0edc02..e3f06f4d1 100644 --- a/tests/ProxyManagerTest/Inflector/Util/ParameterHasherTest.php +++ b/tests/ProxyManagerTest/Inflector/Util/ParameterHasherTest.php @@ -35,6 +35,9 @@ class ParameterHasherTest extends PHPUnit_Framework_TestCase * @dataProvider getParameters * * @covers \ProxyManager\Inflector\Util\ParameterHasher::hashParameters + * + * @param mixed[] $parameters + * @param string $expectedHash */ public function testGeneratesValidClassName(array $parameters, $expectedHash) { diff --git a/tests/ProxyManagerTest/ProxyGenerator/AbstractProxyGeneratorTest.php b/tests/ProxyManagerTest/ProxyGenerator/AbstractProxyGeneratorTest.php index 4f64dbe1b..2b40cec13 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AbstractProxyGeneratorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AbstractProxyGeneratorTest.php @@ -43,6 +43,8 @@ abstract class AbstractProxyGeneratorTest extends PHPUnit_Framework_TestCase * @dataProvider getTestedImplementations * * Verifies that generated code is valid and implements expected interfaces + * + * @param string $className */ public function testGeneratesValidCode($className) { diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptor/MethodGenerator/SetMethodPrefixInterceptorTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptor/MethodGenerator/SetMethodPrefixInterceptorTest.php index 7d0008b98..eb30bc049 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptor/MethodGenerator/SetMethodPrefixInterceptorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptor/MethodGenerator/SetMethodPrefixInterceptorTest.php @@ -37,6 +37,7 @@ class SetMethodPrefixInterceptorTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $suffix PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffix = $this->getMock(PropertyGenerator::class); $suffix->expects($this->once())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptor/MethodGenerator/SetMethodSuffixInterceptorTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptor/MethodGenerator/SetMethodSuffixInterceptorTest.php index 61ae53c0b..c4872171e 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptor/MethodGenerator/SetMethodSuffixInterceptorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptor/MethodGenerator/SetMethodSuffixInterceptorTest.php @@ -37,6 +37,7 @@ class SetMethodSuffixInterceptorTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $suffix PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffix = $this->getMock(PropertyGenerator::class); $suffix->expects($this->once())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/BindProxyPropertiesTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/BindProxyPropertiesTest.php index 5a841718a..81ccbac63 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/BindProxyPropertiesTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/BindProxyPropertiesTest.php @@ -119,7 +119,6 @@ public function testBodyStructure() $this->post = $suffixInterceptors; PHP; - $this->assertSame($expectedCode, $method->getBody()); } diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/InterceptedMethodTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/InterceptedMethodTest.php index 2b7bc1110..c3ad16461 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/InterceptedMethodTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/InterceptedMethodTest.php @@ -38,7 +38,9 @@ class InterceptedMethodTest extends PHPUnit_Framework_TestCase { public function testBodyStructure() { + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $prefixInterceptors->expects($this->any())->method('getName')->will($this->returnValue('pre')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicCloneTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicCloneTest.php index 8ba8c005e..1c0f89eec 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicCloneTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicCloneTest.php @@ -41,7 +41,9 @@ class MagicCloneTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $prefixInterceptors->expects($this->any())->method('getName')->will($this->returnValue('pre')); @@ -60,7 +62,9 @@ public function testBodyStructure() public function testBodyStructureWithInheritedMethod() { $reflection = new ReflectionClass(ClassWithMagicMethods::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $prefixInterceptors->expects($this->any())->method('getName')->will($this->returnValue('pre')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicGetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicGetTest.php index d7f9db4ad..fcd2531e7 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicGetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicGetTest.php @@ -41,7 +41,9 @@ class MagicGetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $prefixInterceptors->expects($this->any())->method('getName')->will($this->returnValue('pre')); @@ -64,7 +66,9 @@ public function testBodyStructure() public function testBodyStructureWithInheritedMethod() { $reflection = new ReflectionClass(ClassWithMagicMethods::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $prefixInterceptors->expects($this->any())->method('getName')->will($this->returnValue('pre')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicIssetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicIssetTest.php index 901e2da35..d14664dcb 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicIssetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicIssetTest.php @@ -41,7 +41,9 @@ class MagicIssetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $prefixInterceptors->expects($this->any())->method('getName')->will($this->returnValue('pre')); @@ -64,7 +66,9 @@ public function testBodyStructure() public function testBodyStructureWithInheritedMethod() { $reflection = new ReflectionClass(ClassWithMagicMethods::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $prefixInterceptors->expects($this->any())->method('getName')->will($this->returnValue('pre')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSetTest.php index 0d3380890..659c0a12b 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSetTest.php @@ -41,7 +41,9 @@ class MagicSetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $prefixInterceptors->expects($this->any())->method('getName')->will($this->returnValue('pre')); @@ -64,7 +66,9 @@ public function testBodyStructure() public function testBodyStructureWithInheritedMethod() { $reflection = new ReflectionClass(ClassWithMagicMethods::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $prefixInterceptors->expects($this->any())->method('getName')->will($this->returnValue('pre')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSleepTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSleepTest.php index b1c009d9d..5fea6c63c 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSleepTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicSleepTest.php @@ -41,7 +41,9 @@ class MagicSleepTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $prefixInterceptors->expects($this->any())->method('getName')->will($this->returnValue('pre')); @@ -64,7 +66,9 @@ public function testBodyStructure() public function testBodyStructureWithInheritedMethod() { $reflection = new ReflectionClass(ClassWithMagicMethods::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $prefixInterceptors->expects($this->any())->method('getName')->will($this->returnValue('pre')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicUnsetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicUnsetTest.php index 452ab2e73..a3d132f8d 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicUnsetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/MagicUnsetTest.php @@ -41,7 +41,9 @@ class MagicUnsetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $prefixInterceptors->expects($this->any())->method('getName')->will($this->returnValue('pre')); @@ -64,7 +66,9 @@ public function testBodyStructure() public function testBodyStructureWithInheritedMethod() { $reflection = new ReflectionClass(ClassWithMagicMethods::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $prefixInterceptors->expects($this->any())->method('getName')->will($this->returnValue('pre')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/Util/InterceptorGeneratorTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/Util/InterceptorGeneratorTest.php index fb3be69c1..dfd6c3461 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/Util/InterceptorGeneratorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/Util/InterceptorGeneratorTest.php @@ -39,10 +39,15 @@ class InterceptorGeneratorTest extends PHPUnit_Framework_TestCase */ public function testInterceptorGenerator() { + /* @var $method MethodGenerator|\PHPUnit_Framework_MockObject_MockObject */ $method = $this->getMock(MethodGenerator::class); + /* @var $bar ParameterGenerator|\PHPUnit_Framework_MockObject_MockObject */ $bar = $this->getMock(ParameterGenerator::class); + /* @var $baz ParameterGenerator|\PHPUnit_Framework_MockObject_MockObject */ $baz = $this->getMock(ParameterGenerator::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $bar->expects($this->any())->method('getName')->will($this->returnValue('bar')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/InterceptedMethodTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/InterceptedMethodTest.php index 11ee0a014..0075e3a09 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/InterceptedMethodTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/InterceptedMethodTest.php @@ -38,8 +38,11 @@ class InterceptedMethodTest extends PHPUnit_Framework_TestCase { public function testBodyStructure() { + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $valueHolder->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicCloneTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicCloneTest.php index 0851380eb..2d10aecb5 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicCloneTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicCloneTest.php @@ -40,8 +40,11 @@ class MagicCloneTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $valueHolder->expects($this->any())->method('getName')->will($this->returnValue('bar')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicGetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicGetTest.php index 56eec6760..ee5998664 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicGetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicGetTest.php @@ -41,9 +41,13 @@ class MagicGetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $publicProperties PublicPropertiesMap|\PHPUnit_Framework_MockObject_MockObject */ $publicProperties = $this ->getMockBuilder(PublicPropertiesMap::class) ->disableOriginalConstructor() diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicIssetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicIssetTest.php index 1348398e0..fa5a3cde1 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicIssetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicIssetTest.php @@ -41,9 +41,13 @@ class MagicIssetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $publicProperties PublicPropertiesMap|\PHPUnit_Framework_MockObject_MockObject */ $publicProperties = $this ->getMockBuilder(PublicPropertiesMap::class) ->disableOriginalConstructor() diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicSetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicSetTest.php index c0a16c34d..c516046a5 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicSetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicSetTest.php @@ -41,9 +41,13 @@ class MagicSetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $publicProperties PublicPropertiesMap|\PHPUnit_Framework_MockObject_MockObject */ $publicProperties = $this ->getMockBuilder(PublicPropertiesMap::class) ->disableOriginalConstructor() diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicUnsetTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicUnsetTest.php index 4a8d24d39..cf5895380 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicUnsetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/MagicUnsetTest.php @@ -41,9 +41,13 @@ class MagicUnsetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $publicProperties PublicPropertiesMap|\PHPUnit_Framework_MockObject_MockObject */ $publicProperties = $this ->getMockBuilder(PublicPropertiesMap::class) ->disableOriginalConstructor() diff --git a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/Util/InterceptorGeneratorTest.php b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/Util/InterceptorGeneratorTest.php index 3bd5de81a..7354222ea 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/Util/InterceptorGeneratorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptorValueHolder/MethodGenerator/Util/InterceptorGeneratorTest.php @@ -39,11 +39,17 @@ class InterceptorGeneratorTest extends PHPUnit_Framework_TestCase */ public function testInterceptorGenerator() { + /* @var $method MethodGenerator|\PHPUnit_Framework_MockObject_MockObject */ $method = $this->getMock(MethodGenerator::class); + /* @var $bar ParameterGenerator|\PHPUnit_Framework_MockObject_MockObject */ $bar = $this->getMock(ParameterGenerator::class); + /* @var $baz ParameterGenerator|\PHPUnit_Framework_MockObject_MockObject */ $baz = $this->getMock(ParameterGenerator::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); + /* @var $prefixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $prefixInterceptors = $this->getMock(PropertyGenerator::class); + /* @var $suffixInterceptors PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $suffixInterceptors = $this->getMock(PropertyGenerator::class); $bar->expects($this->any())->method('getName')->will($this->returnValue('bar')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoading/MethodGenerator/StaticProxyConstructorTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoading/MethodGenerator/StaticProxyConstructorTest.php index ccb4efaf3..643b2a3d3 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoading/MethodGenerator/StaticProxyConstructorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoading/MethodGenerator/StaticProxyConstructorTest.php @@ -22,8 +22,6 @@ use ProxyManager\ProxyGenerator\LazyLoading\MethodGenerator\StaticProxyConstructor; use ProxyManager\ProxyGenerator\Util\Properties; use ProxyManagerTestAsset\ClassWithMixedProperties; -use ProxyManagerTestAsset\EmptyClass; -use ProxyManagerTestAsset\ProxyGenerator\LazyLoading\MethodGenerator\ClassWithTwoPublicProperties; use ReflectionClass; use Zend\Code\Generator\PropertyGenerator; diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/CallInitializerTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/CallInitializerTest.php index d5d8c6ef1..15f10cd5c 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/CallInitializerTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/CallInitializerTest.php @@ -106,7 +106,6 @@ public function testBodyStructure() $this->init->__invoke($this, $methodName, $parameters, $this->init, $properties); $this->track = false;'; - $this->assertSame( $expectedCode, $callInitializer->getBody() diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/GetProxyInitializerTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/GetProxyInitializerTest.php index 44a5298a7..43b3b87a2 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/GetProxyInitializerTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/GetProxyInitializerTest.php @@ -37,6 +37,7 @@ class GetProxyInitializerTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/InitializeProxyTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/InitializeProxyTest.php index 9e93c1fe5..6422e5df3 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/InitializeProxyTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/InitializeProxyTest.php @@ -38,7 +38,9 @@ class InitializeProxyTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $initCall MethodGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initCall = $this->getMock(MethodGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/IsProxyInitializedTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/IsProxyInitializedTest.php index 0adb85666..af22a2111 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/IsProxyInitializedTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/IsProxyInitializedTest.php @@ -37,6 +37,7 @@ class IsProxyInitializedTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/LazyLoadingMethodInterceptorTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/LazyLoadingMethodInterceptorTest.php index f5c6fac6b..cd1574e67 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/LazyLoadingMethodInterceptorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/LazyLoadingMethodInterceptorTest.php @@ -40,7 +40,9 @@ class LazyLoadingMethodInterceptorTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $initCall MethodGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initCall = $this->getMock(MethodGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); @@ -65,7 +67,9 @@ public function testBodyStructure() public function testBodyStructureWithoutParameters() { $reflectionMethod = new MethodReflection(__CLASS__, 'testBodyStructureWithoutParameters'); + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $initCall MethodGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initCall = $this->getMock(MethodGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicCloneTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicCloneTest.php index 95ba8a1c0..5f7c74fc3 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicCloneTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicCloneTest.php @@ -41,7 +41,9 @@ class MagicCloneTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $initCall MethodGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initCall = $this->getMock(MethodGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicGetTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicGetTest.php index 1e0b904e2..ed8422b0c 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicGetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicGetTest.php @@ -25,8 +25,6 @@ use ProxyManager\ProxyGenerator\PropertyGenerator\PublicPropertiesMap; use ProxyManagerTestAsset\BaseClass; use ProxyManagerTestAsset\ClassWithMagicMethods; -use ProxyManagerTestAsset\EmptyClass; -use ProxyManagerTestAsset\ProxyGenerator\LazyLoading\MethodGenerator\ClassWithTwoPublicProperties; use ReflectionClass; use Zend\Code\Generator\MethodGenerator; use Zend\Code\Generator\PropertyGenerator; diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicIssetTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicIssetTest.php index d59d4bd8e..6976a3db3 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicIssetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicIssetTest.php @@ -24,7 +24,6 @@ use ProxyManager\ProxyGenerator\LazyLoadingGhost\PropertyGenerator\ProtectedPropertiesMap; use ProxyManager\ProxyGenerator\PropertyGenerator\PublicPropertiesMap; use ProxyManagerTestAsset\ClassWithMagicMethods; -use ProxyManagerTestAsset\EmptyClass; use ProxyManagerTestAsset\ProxyGenerator\LazyLoading\MethodGenerator\ClassWithTwoPublicProperties; use ReflectionClass; use Zend\Code\Generator\MethodGenerator; @@ -125,7 +124,6 @@ class MagicIssetTest extends PHPUnit_Framework_TestCase %A PHP; - /** * {@inheritDoc} */ diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicSetTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicSetTest.php index ddbae4a0e..e4f001848 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicSetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicSetTest.php @@ -25,7 +25,6 @@ use ProxyManager\ProxyGenerator\PropertyGenerator\PublicPropertiesMap; use ProxyManagerTestAsset\ClassWithMagicMethods; use ProxyManagerTestAsset\EmptyClass; -use ProxyManagerTestAsset\ProxyGenerator\LazyLoading\MethodGenerator\ClassWithTwoPublicProperties; use ReflectionClass; use Zend\Code\Generator\MethodGenerator; use Zend\Code\Generator\PropertyGenerator; diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicSleepTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicSleepTest.php index b4454f470..8422be627 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicSleepTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicSleepTest.php @@ -41,7 +41,9 @@ class MagicSleepTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $initMethod MethodGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initMethod = $this->getMock(MethodGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicUnsetTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicUnsetTest.php index 056a1febf..b819a7f1f 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicUnsetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/MagicUnsetTest.php @@ -24,7 +24,6 @@ use ProxyManager\ProxyGenerator\LazyLoadingGhost\PropertyGenerator\ProtectedPropertiesMap; use ProxyManager\ProxyGenerator\PropertyGenerator\PublicPropertiesMap; use ProxyManagerTestAsset\ClassWithMagicMethods; -use ProxyManagerTestAsset\EmptyClass; use ProxyManagerTestAsset\ProxyGenerator\LazyLoading\MethodGenerator\ClassWithTwoPublicProperties; use ReflectionClass; use Zend\Code\Generator\MethodGenerator; diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/SetProxyInitializerTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/SetProxyInitializerTest.php index c38177b98..a25ab820f 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/SetProxyInitializerTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/SetProxyInitializerTest.php @@ -38,6 +38,7 @@ class SetProxyInitializerTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/PropertyGenerator/PrivatePropertiesMapTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/PropertyGenerator/PrivatePropertiesMapTest.php index cf3d1efb5..47a593f54 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/PropertyGenerator/PrivatePropertiesMapTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/PropertyGenerator/PrivatePropertiesMapTest.php @@ -18,7 +18,6 @@ namespace ProxyManagerTest\ProxyGenerator\LazyLoadingGhost\PropertyGenerator; -use ProxyManager\ProxyGenerator\LazyLoadingGhost\PropertyGenerator\InitializerProperty; use ProxyManager\ProxyGenerator\LazyLoadingGhost\PropertyGenerator\PrivatePropertiesMap; use ProxyManager\ProxyGenerator\LazyLoadingGhost\PropertyGenerator\ProtectedPropertiesMap; use ProxyManagerTest\ProxyGenerator\PropertyGenerator\AbstractUniquePropertyNameTest; diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/PropertyGenerator/ProtectedPropertiesMapTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/PropertyGenerator/ProtectedPropertiesMapTest.php index 4ffd66519..53ecf7d83 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/PropertyGenerator/ProtectedPropertiesMapTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/PropertyGenerator/ProtectedPropertiesMapTest.php @@ -18,7 +18,6 @@ namespace ProxyManagerTest\ProxyGenerator\LazyLoadingGhost\PropertyGenerator; -use ProxyManager\ProxyGenerator\LazyLoadingGhost\PropertyGenerator\InitializerProperty; use ProxyManager\ProxyGenerator\LazyLoadingGhost\PropertyGenerator\ProtectedPropertiesMap; use ProxyManagerTest\ProxyGenerator\PropertyGenerator\AbstractUniquePropertyNameTest; use ProxyManagerTestAsset\ClassWithAbstractProtectedMethod; diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/GetProxyInitializerTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/GetProxyInitializerTest.php index 51df81d71..bb6cd5ecc 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/GetProxyInitializerTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/GetProxyInitializerTest.php @@ -37,6 +37,7 @@ class GetProxyInitializerTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/InitializeProxyTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/InitializeProxyTest.php index fc956ccd9..cef11b947 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/InitializeProxyTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/InitializeProxyTest.php @@ -37,7 +37,9 @@ class InitializeProxyTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/IsProxyInitializedTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/IsProxyInitializedTest.php index 921f563de..dd65d596e 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/IsProxyInitializedTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/IsProxyInitializedTest.php @@ -37,6 +37,7 @@ class IsProxyInitializedTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); $valueHolder->expects($this->any())->method('getName')->will($this->returnValue('bar')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/LazyLoadingMethodInterceptorTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/LazyLoadingMethodInterceptorTest.php index 1722511e8..d058da51f 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/LazyLoadingMethodInterceptorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/LazyLoadingMethodInterceptorTest.php @@ -39,7 +39,9 @@ class LazyLoadingMethodInterceptorTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); @@ -64,7 +66,9 @@ public function testBodyStructure() public function testBodyStructureWithoutParameters() { $reflectionMethod = new MethodReflection(__CLASS__, 'testBodyStructureWithoutParameters'); + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicCloneTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicCloneTest.php index a983dd3c2..f411d8847 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicCloneTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicCloneTest.php @@ -40,7 +40,9 @@ class MagicCloneTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicGetTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicGetTest.php index 5d969150e..6ec01426c 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicGetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicGetTest.php @@ -41,8 +41,11 @@ class MagicGetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); + /* @var $publicProperties PublicPropertiesMap|\PHPUnit_Framework_MockObject_MockObject */ $publicProperties = $this ->getMockBuilder(PublicPropertiesMap::class) ->disableOriginalConstructor() diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicIssetTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicIssetTest.php index daa1c66e6..cbe29d9b6 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicIssetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicIssetTest.php @@ -41,8 +41,11 @@ class MagicIssetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); + /* @var $publicProperties PublicPropertiesMap|\PHPUnit_Framework_MockObject_MockObject */ $publicProperties = $this ->getMockBuilder(PublicPropertiesMap::class) ->disableOriginalConstructor() diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSetTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSetTest.php index 180f4a396..1989bb92f 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSetTest.php @@ -41,8 +41,11 @@ class MagicSetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); + /* @var $publicProperties PublicPropertiesMap|\PHPUnit_Framework_MockObject_MockObject */ $publicProperties = $this ->getMockBuilder(PublicPropertiesMap::class) ->disableOriginalConstructor() diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSleepTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSleepTest.php index 6301b97fe..a001a8ab6 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSleepTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicSleepTest.php @@ -40,7 +40,9 @@ class MagicSleepTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicUnsetTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicUnsetTest.php index e867bb80a..0e5ccf56f 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicUnsetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/MagicUnsetTest.php @@ -41,8 +41,11 @@ class MagicUnsetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); + /* @var $publicProperties PublicPropertiesMap|\PHPUnit_Framework_MockObject_MockObject */ $publicProperties = $this ->getMockBuilder(PublicPropertiesMap::class) ->disableOriginalConstructor() diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/SetProxyInitializerTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/SetProxyInitializerTest.php index 8228ab4aa..f856eb229 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/SetProxyInitializerTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/SetProxyInitializerTest.php @@ -38,6 +38,7 @@ class SetProxyInitializerTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/NullObjectGeneratorTest.php b/tests/ProxyManagerTest/ProxyGenerator/NullObjectGeneratorTest.php index 6df43802c..840626691 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/NullObjectGeneratorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/NullObjectGeneratorTest.php @@ -32,7 +32,6 @@ use ProxyManagerTestAsset\ClassWithMixedProperties; use ReflectionClass; use ReflectionMethod; -use ReflectionProperty; /** * Tests for {@see \ProxyManager\ProxyGenerator\NullObjectGenerator} @@ -49,6 +48,8 @@ class NullObjectGeneratorTest extends PHPUnit_Framework_TestCase * @dataProvider getTestedImplementations * * Verifies that generated code is valid and implements expected interfaces + * + * @param string $className */ public function testGeneratesValidCode($className) { diff --git a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicGetTest.php b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicGetTest.php index 71174989e..374293944 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicGetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicGetTest.php @@ -40,6 +40,7 @@ class MagicGetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $adapter PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $adapter = $this->getMock(PropertyGenerator::class); $adapter->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicIssetTest.php b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicIssetTest.php index a01441925..9b3bdd495 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicIssetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicIssetTest.php @@ -40,6 +40,7 @@ class MagicIssetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $adapter PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $adapter = $this->getMock(PropertyGenerator::class); $adapter->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicSetTest.php b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicSetTest.php index f93a9627c..24583994c 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicSetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicSetTest.php @@ -40,6 +40,7 @@ class MagicSetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $adapter PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $adapter = $this->getMock(PropertyGenerator::class); $adapter->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicUnsetTest.php b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicUnsetTest.php index 24ce1e529..6bb4e0cc4 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicUnsetTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/MagicUnsetTest.php @@ -40,6 +40,7 @@ class MagicUnsetTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $adapter PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $adapter = $this->getMock(PropertyGenerator::class); $adapter->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/RemoteObjectMethodTest.php b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/RemoteObjectMethodTest.php index 1a9e49c39..8890c0bea 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/RemoteObjectMethodTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/RemoteObject/MethodGenerator/RemoteObjectMethodTest.php @@ -40,6 +40,7 @@ class RemoteObjectMethodTest extends PHPUnit_Framework_TestCase */ public function testBodyStructureWithParameters() { + /* @var $adapter PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $adapter = $this->getMock(PropertyGenerator::class); $adapter->expects($this->any())->method('getName')->will($this->returnValue('adapter')); @@ -69,6 +70,7 @@ public function testBodyStructureWithParameters() */ public function testBodyStructureWithArrayParameter() { + /* @var $adapter PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $adapter = $this->getMock(PropertyGenerator::class); $adapter->expects($this->any())->method('getName')->will($this->returnValue('adapter')); @@ -95,6 +97,7 @@ public function testBodyStructureWithArrayParameter() */ public function testBodyStructureWithoutParameters() { + /* @var $adapter PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $adapter = $this->getMock(PropertyGenerator::class); $adapter->expects($this->any())->method('getName')->will($this->returnValue('adapter')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/RemoteObjectGeneratorTest.php b/tests/ProxyManagerTest/ProxyGenerator/RemoteObjectGeneratorTest.php index 06be30c9a..14beed9f0 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/RemoteObjectGeneratorTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/RemoteObjectGeneratorTest.php @@ -46,6 +46,8 @@ class RemoteObjectGeneratorTest extends PHPUnit_Framework_TestCase * @dataProvider getTestedImplementations * * Verifies that generated code is valid and implements expected interfaces + * + * @param string $className */ public function testGeneratesValidCode($className) { diff --git a/tests/ProxyManagerTest/ProxyGenerator/Util/PropertiesTest.php b/tests/ProxyManagerTest/ProxyGenerator/Util/PropertiesTest.php index 7eaadbb33..657569b51 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/Util/PropertiesTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/Util/PropertiesTest.php @@ -20,20 +20,12 @@ use PHPUnit_Framework_TestCase; use ProxyManager\ProxyGenerator\Util\Properties; -use ProxyManager\ProxyGenerator\Util\ProxiedMethodsFilter; -use ProxyManagerTestAsset\BaseClass; -use ProxyManagerTestAsset\ClassWithAbstractMagicMethods; use ProxyManagerTestAsset\ClassWithAbstractProtectedMethod; use ProxyManagerTestAsset\ClassWithAbstractPublicMethod; use ProxyManagerTestAsset\ClassWithCollidingPrivateInheritedProperties; -use ProxyManagerTestAsset\ClassWithMagicMethods; use ProxyManagerTestAsset\ClassWithMixedProperties; use ProxyManagerTestAsset\ClassWithPrivateProperties; -use ProxyManagerTestAsset\EmptyClass; -use ProxyManagerTestAsset\HydratedObject; -use ProxyManagerTestAsset\LazyLoadingMock; use ReflectionClass; -use ReflectionMethod; use ReflectionProperty; /** diff --git a/tests/ProxyManagerTest/ProxyGenerator/ValueHolder/MethodGenerator/GetWrappedValueHolderValueTest.php b/tests/ProxyManagerTest/ProxyGenerator/ValueHolder/MethodGenerator/GetWrappedValueHolderValueTest.php index 47715a7a3..38b02a46d 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/ValueHolder/MethodGenerator/GetWrappedValueHolderValueTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/ValueHolder/MethodGenerator/GetWrappedValueHolderValueTest.php @@ -37,6 +37,7 @@ class GetWrappedValueHolderValueTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); $valueHolder->expects($this->any())->method('getName')->will($this->returnValue('foo')); diff --git a/tests/ProxyManagerTest/ProxyGenerator/ValueHolder/MethodGenerator/MagicSleepTest.php b/tests/ProxyManagerTest/ProxyGenerator/ValueHolder/MethodGenerator/MagicSleepTest.php index 41d4c22fc..47e8b14d2 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/ValueHolder/MethodGenerator/MagicSleepTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/ValueHolder/MethodGenerator/MagicSleepTest.php @@ -40,6 +40,7 @@ class MagicSleepTest extends PHPUnit_Framework_TestCase public function testBodyStructure() { $reflection = new ReflectionClass(EmptyClass::class); + /* @var $valueHolder PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $valueHolder = $this->getMock(PropertyGenerator::class); $valueHolder->expects($this->any())->method('getName')->will($this->returnValue('bar'));