* @license MIT * * @group Coverage */ class MagicSleepTest extends PHPUnit_Framework_TestCase { /** * @covers \ProxyManager\ProxyGenerator\ValueHolder\MethodGenerator\MagicSleep::__construct */ public function testBodyStructure() { $reflection = new ReflectionClass('ProxyManagerTestAsset\\EmptyClass'); $valueHolder = $this->getMock('Zend\\Code\\Generator\\PropertyGenerator'); $valueHolder->expects($this->any())->method('getName')->will($this->returnValue('bar')); $magicSleep = new MagicSleep($reflection, $valueHolder); $this->assertSame('__sleep', $magicSleep->getName()); $this->assertCount(0, $magicSleep->getParameters()); $this->assertSame( "return array('bar');", $magicSleep->getBody() ); } }