/** @test */ public function itShouldHaveAnInitialValueAndType() { $prop = new Property('foo'); $expected = <<<PHP /** @var string */ private \$foo = 'foo'; PHP; $prop->setValue("'foo'"); $prop->setType(Property::T_STRING); $prop->setVisibility(Property::IS_PRIVATE); $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()); }