/** @test */ public function itShouldWriteAbstract() { $expected = <<<PHP /** * getFoo * * @return void */ abstract public function getFoo(); PHP; $method = new Method('getFoo'); $method->setAbstract(true); $this->assertSame($expected, $method->generate()); }
/** * Constructor. * * @param string $name * @param string $type * @param bool $static */ public function __construct($name, $type = self::T_VOID, $static = false) { parent::__construct($name, self::IS_PUBLIC, $type, $static); }
/** @test */ public function itShouldHaveMethods() { $cg = $this->newObw('Foo', 'Acme'); $cg->noAutoGenerateTag(); $cg->setMethods([$m = new Method('__construct')]); $m->addArgument(new Argument('bar', 'Bar')); $c = $this->getContents('class.4.php'); $this->assertEquals($c = $this->getContents('class.4.php'), $cg->generate()); }