getProperties() public method

public getProperties ( ) : Zend\Code\Generator\PropertyGenerator[]
return Zend\Code\Generator\PropertyGenerator[]
Exemplo n.º 1
0
 public function testPropertyAccessors()
 {
     $classGenerator = new ClassGenerator();
     $classGenerator->addProperties(array('propOne', new PropertyGenerator('propTwo')));
     $properties = $classGenerator->getProperties();
     $this->assertEquals(count($properties), 2);
     $this->assertInstanceOf('Zend\\Code\\Generator\\PropertyGenerator', current($properties));
     $property = $classGenerator->getProperty('propTwo');
     $this->assertInstanceOf('Zend\\Code\\Generator\\PropertyGenerator', $property);
     $this->assertEquals($property->getName(), 'propTwo');
     // add a new property
     $classGenerator->addProperty('prop3');
     $this->assertEquals(count($classGenerator->getProperties()), 3);
 }