/**
  * @param RequestInterface $request
  *
  * @return RequestInterface
  */
 private function appendQueryParams(RequestInterface $request)
 {
     $queryParams = $this->auth->getQueryParameters();
     foreach ($queryParams as $key => $value) {
         $uri = Uri::withQueryValue($request->getUri(), $key, $value);
         $request = $request->withUri($uri);
     }
     return $request;
 }
 /**
  * @test
  */
 public function invoke_QueryParameters_Success()
 {
     $this->auth->expects($this->once())->method('getHeaders')->willReturn([]);
     $this->auth->expects($this->once())->method('getQueryParameters')->willReturn(['jwt' => 'YYYY', 'otherParam' => 'YYYY']);
     $this->request->expects($this->exactly(3))->method('getUri')->willReturn($this->uri);
     $this->request->expects($this->exactly(2))->method('withUri')->withConsecutive(Uri::withQueryValue($this->uri, 'jwt', 'YYYY'), Uri::withQueryValue($this->uri, 'otherParam', 'YYYY'))->willReturnSelf();
     $middleware = new ConnectMiddleware($this->auth, $this->appContext);
     $callable = $middleware(function (RequestInterface $actualRequest, array $options) {
         $this->assertEquals($this->request, $actualRequest);
         $this->assertEquals(['Hello World'], $options);
     });
     $callable($this->request, ['Hello World']);
 }