Esempio n. 1
0
    public function testNameAccessors()
    {
        $codeGenClass = new Php\PhpClass();
        $codeGenClass->setName('TestClass');
        $this->assertEquals($codeGenClass->getName(), 'TestClass');

    }
Esempio n. 2
0
 /**
  * setClass()
  *
  * @param \Zend\CodeGenerator\Php\PhpClass|array $class
  * @return \Zend\CodeGenerator\Php\PhpFile
  */
 public function setClass($class)
 {
     if (is_array($class)) {
         $class = new PhpClass($class);
         $className = $class->getName();
     } elseif ($class instanceof PhpClass) {
         $className = $class->getName();
     } else {
         throw new Exception\InvalidArgumentException('Expecting either an array or an instance of Zend_CodeGenerator_Php_Class');
     }
     // @todo check for dup here
     $this->_classes[$className] = $class;
     return $this;
 }