Example #1
0
    /** @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);
    }
Example #2
0
 /** @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());
 }