* @license MIT * * @group Coverage */ class MagicUnsetTest extends PHPUnit_Framework_TestCase { /** * @covers \ProxyManager\ProxyGenerator\RemoteObject\MethodGenerator\MagicUnset::__construct */ public function testBodyStructure() { $reflection = new ReflectionClass('ProxyManagerTestAsset\\EmptyClass'); $adapter = $this->getMock('Zend\\Code\\Generator\\PropertyGenerator'); $adapter->expects($this->any())->method('getName')->will($this->returnValue('foo')); $magicGet = new MagicUnset($reflection, $adapter); $this->assertSame('__unset', $magicGet->getName()); $this->assertCount(1, $magicGet->getParameters()); $this->assertStringMatchesFormat( '$return = $this->foo->call(\'ProxyManagerTestAsset\\\EmptyClass\', \'__unset\', array($name));' . "\n\nreturn \$return;", $magicGet->getBody() ); } }