/** * Add properties */ function it_add_properties(CodeFactoryContract $factory, PHPProperty $property) { $factory->buildProperty($name = 'foo', $modifiers = 'bar')->willReturn($property)->shouldBeCalled(); $this->property($name, $modifiers)->shouldReturn($this); $this->getProperties()->shouldBe([$property]); }
/** * Add a property to the class * * @param string $name * @param int $modifiers * * @return $this */ public function property($name, $modifiers = 0) { $this->properties[] = $this->codeFactory->buildProperty($name, $modifiers); return $this; }