* @license MIT * * @covers \ProxyManager\Exception\InvalidProxiedClassException * @group Coverage */ class InvalidProxiedClassExceptionTest extends PHPUnit_Framework_TestCase { public function testInterfaceNotSupported() { $this->assertSame( 'Provided interface "ProxyManagerTestAsset\BaseInterface" cannot be proxied', InvalidProxiedClassException::interfaceNotSupported( new ReflectionClass('ProxyManagerTestAsset\BaseInterface') )->getMessage() ); } public function testFinalClassNotSupported() { $this->assertSame( 'Provided class "ProxyManagerTestAsset\FinalClass" is final and cannot be proxied', InvalidProxiedClassException::finalClassNotSupported( new ReflectionClass('ProxyManagerTestAsset\FinalClass') )->getMessage() ); } public function testAbstractProtectedMethodsNotSupported() { $this->assertSame( 'Provided class "ProxyManagerTestAsset\ClassWithAbstractProtectedMethod" has following protected abstract' . ' methods, and therefore cannot be proxied:' . "\n" . 'ProxyManagerTestAsset\ClassWithAbstractProtectedMethod::protectedAbstractMethod', InvalidProxiedClassException::abstractProtectedMethodsNotSupported( new ReflectionClass('ProxyManagerTestAsset\ClassWithAbstractProtectedMethod') )->getMessage() ); } }