/** @test */ public function itIsExpectedThat() { $expected = <<<PHP /** * Acme\\Foo\\Wahtever * * @var mixed * * @ORM\\Column(type="integer") * @ORM\\Id * @ORM\\GeneratedValue(strategy="AUTO") */ public \$id; PHP; $prop = new Property('id'); $prop->setDescription('Acme\\Foo\\Wahtever'); $prop->addAnnotation('ORM\\Column(type="integer")'); $prop->addAnnotation('ORM\\Id'); $prop->addAnnotation('ORM\\GeneratedValue(strategy="AUTO")'); $this->assertSame($expected, (string) $prop); }
/** @test */ public function itShouldHaveProperties() { $cg = $this->newObw('Foo', 'Acme'); $cg->noAutoGenerateTag(); $cg->setProperties([new Property('bar', Property::IS_PRIVATE), $p = new Property('baz', Property::IS_PUBLIC, 'string')]); $p->setValue("'baz'"); $this->assertEquals($this->getContents('class.3.php'), $cg->generate()); }