public function testInterfacesMethods() { $interfaces = array('interface1', 'interface2', 'interface3'); $this->class->setInterfaces($interfaces); $this->assertEquals($interfaces, $this->class->getInterfaces(), 'Get interface should return previously set interfaces'); $this->class->addInterface('interface4'); $this->assertEquals(array_merge($interfaces, array('interface4')), $this->class->getInterfaces()); $this->class->removeInterface('interface2'); $this->assertEquals(array('interface1', 'interface3', 'interface4'), array_values($this->class->getInterfaces())); }
/** * 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)); }