public function testMetaClass() { $class = $this->phpyClass; $props = $this->phpyClass->getProperties(); $methods = $this->phpyClass->getMethods(); $this->assertEquals('DummyClass', $class->getName()); $this->assertTrue($class->isAbstract()); $this->assertEquals('Phpy\\Test\\Reflection', $class->getNamespace()); $this->assertTrue($class->implementsInterface('Phpy\\Test\\Reflection\\DummyInterface')); $this->assertEquals($props, $this->phpyProps); $this->assertEquals($methods, $this->phpyMethods); $this->assertEquals('stdClass', $this->phpyExtendedClass->getParent()->getName()); }
/** * Get Vars to be rendered in the template * * @param MetaClass $class * @return array */ private function getTmplVars(MetaClass $class) { $parent = $class->getParent(); $interfaces = $class->getInterfaces(); return array('className' => $class->getName(), 'extends' => $parent ? ' extends ' . $parent->getName() : '', 'interfaces' => $interfaces ? ' implements ' . implode(', ', $interfaces) : '', 'properties' => $this->realizeProperties($class), 'methods' => $this->realizeMethods($class)); }