コード例 #1
0
 public function testValidManagerWhenInvalidMethod()
 {
     $methods = $this->interfaceManager->getMethods();
     $methods->add(new MethodGetterInterfaceManager($this->interfaceManager->getClassManager()));
     // broken method
     $this->interfaceManager->setMethods($methods);
     $errors = $this->getValidator()->validate($this->interfaceManager);
     $this->assertEquals(1, $errors->count());
 }
コード例 #2
0
 /**
  * @param InterfaceManager $interface
  * @return string
  * @throws RendererException
  */
 protected function renderInterface(InterfaceManager $interface)
 {
     $template = $interface->getTemplate();
     $tags = $interface->getTemplateTags();
     $methods = [];
     foreach ($interface->getMethods() as $method) {
         $methods[] = $this->render($method);
     }
     $args[RenderableInterface::TAG_NAMESPACE] = $interface->getNamespaceWithoutNameAndBackslashPrefix();
     $args[RenderableInterface::TAG_COMMENT] = $interface->getComment();
     $args[RenderableInterface::TAG_NAME] = $interface->getName();
     $args[RenderableInterface::TAG_METHODS] = Tools::implodeArrayToTemplate($methods);
     return $this->addNewLineAfter($this->replace($tags, $args, $template));
 }