Exemple #1
0
 public function testGetAndSetName()
 {
     $this->property->setName('xxx');
     $this->assertEquals('xxx', $this->property->getName());
 }
Exemple #2
0
 /**
  * Add a property to the class
  *
  * @param Property $property
  * @throws \InvalidArgumentException
  * @return MetaClass The current instance
  */
 public function addProperty(Property $property)
 {
     if ($this->hasProperty($property->getName())) {
         throw new \InvalidArgumentException('Class already has a property named ' . $property->getName());
     }
     $this->properties[] = $property;
     return $this;
 }