/**
  * @param string $url
  * @return ServiceDescription
  */
 public function createServiceDescription($url)
 {
     $serviceDescription = new ServiceDescription($url, $this->namespace);
     foreach ($this->serviceRegistry->getAllServices() as $actionMetadata) {
         if (!$actionMetadata) {
             continue;
         }
         $actionDescription = new ActionDescription($actionMetadata->alias);
         foreach ($actionMetadata->methodMetadata as $methodMetadata) {
             /** @var MethodMetadata $methodMetadata */
             if (!$methodMetadata->isMethod) {
                 continue;
             }
             $parameters = array();
             foreach ($methodMetadata->parameters as $parameter) {
                 if (($class = $parameter->getClass()) === null || $class->name !== HttpRequest::class && $class->name !== DirectRequest::class && $class->name !== ArgumentValidationResult::class) {
                     $parameters[] = $parameter->name;
                 }
             }
             $actionDescription->addMethod(new MethodDescription($methodMetadata->name, $methodMetadata->isFormHandler, $parameters, $methodMetadata->hasNamedParams, $methodMetadata->isStrict));
         }
         if (count($actionDescription->getMethods())) {
             $serviceDescription->addAction($actionDescription);
         }
     }
     return $serviceDescription;
 }
 public function testSetMethods()
 {
     $a = new ActionDescription('action', array(new MethodDescription('method1')));
     $a->setMethods(array(new MethodDescription('method2'), new MethodDescription('method3')));
     $this->assertCount(2, $a->getMethods());
 }