/**
  * {@inheritdoc}
  *
  * @return Request[]
  */
 public function generate(ResourceInterface $resource = null)
 {
     /** @var OperationInterface[] $operations */
     $operations = array_merge($resource->getCollectionOperations(), $resource->getItemOperations());
     $requests = [];
     foreach ($operations as $operation) {
         $route = $operation->getRoute();
         foreach ($route->getMethods() as $method) {
             $request = new Request();
             $request->setResource($resource);
             $request->setId((string) Uuid::uuid4());
             $request->setUrl($this->baseUrl . $route->getPath());
             $request->setMethod($method);
             if (isset($operation->getContext()['hydra:title'])) {
                 $request->setName($operation->getContext()['hydra:title']);
             }
             $this->requestParser->parse($request);
             $requests[] = $request;
         }
     }
     return $requests;
 }
 public function testParse()
 {
     $this->requestParserMock->supports($this->requestMock->reveal())->willReturn(true, false)->shouldBeCalledTimes(2);
     $this->requestParserMock->parse($this->requestMock->reveal())->shouldBeCalledTimes(1);
     $this->parser->parse($this->requestMock->reveal());
 }