/** * @covers ::generate */ public function testGenerate() { $classProperty = $this->classProperty->generate(); $expectedProperty = ' /** * @var string */ private $testing;'; $this->assertEquals($classProperty, $expectedProperty); }
/** * @return ClassMethod */ protected function generateAdd() { $setter = new ClassMethod('add' . ucfirst($this->classProperty->getName())); $setter->setDescription('Add item to ' . $this->classProperty->getName()); $setterParam = new MethodParameter($this->classProperty->getName(), 'mixed'); $setter->addParameter($setterParam); $body = <<<BODY \t\$this->{$this->classProperty->getName()} = \${$this->classProperty->getName()}; BODY; $setter->setBody($body); return $setter; }