* @license MIT * * @group Coverage */ class MagicSetTest extends PHPUnit_Framework_TestCase { /** * @covers \ProxyManager\ProxyGenerator\RemoteObject\MethodGenerator\MagicSet::__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 MagicSet($reflection, $adapter); $this->assertSame('__set', $magicGet->getName()); $this->assertCount(2, $magicGet->getParameters()); $this->assertStringMatchesFormat( '$return = $this->foo->call(\'ProxyManagerTestAsset\\\EmptyClass\', \'__set\', array($name, $value));' . "\n\nreturn \$return;", $magicGet->getBody() ); } }