/** * Constructor * * @param Zend_Server_Reflection_Class $class * @param ReflectionMethod $r * @param string $namespace * @param array $argv * @return void */ public function __construct(Zend_Server_Reflection_Class $class, ReflectionMethod $r, $namespace = null, $argv = array()) { $this->_classReflection = $class; $this->_reflection = $r; $classNamespace = $class->getNamespace(); // Determine namespace if (!empty($namespace)) { $this->setNamespace($namespace); } elseif (!empty($classNamespace)) { $this->setNamespace($classNamespace); } // Determine arguments if (is_array($argv)) { $this->_argv = $argv; } // If method call, need to store some info on the class $this->_class = $class->getName(); // Perform some introspection $this->_reflect(); }
/** * namespace test */ public function testGetNamespace() { $r = new Zend_Server_Reflection_Class(new ReflectionClass('Zend_Server_Reflection')); $this->assertEquals('', $r->getNamespace()); $r->setNamespace('namespace'); $this->assertEquals('namespace', $r->getNamespace()); }