public function testGettersAndSetters()
 {
     $token = 'abc';
     $clientInfo = $this->getMock('InoOicClient\\Client\\ClientInfo');
     $request = new Request();
     $request->setAccessToken($token);
     $request->setClientInfo($clientInfo);
     $this->assertSame($token, $request->getAccessToken());
     $this->assertSame($clientInfo, $request->getClientInfo());
 }
 /**
  * Creates a HTTP request based on the userinfo request.
  * 
  * @param Request $request
  * @param Http\Request $httpRequest
  * @return Http\Request
  */
 public function buildHttpRequest(Request $request, Http\Request $httpRequest = null)
 {
     if (null === $httpRequest) {
         $httpRequest = new Http\Request();
     }
     $clientInfo = $request->getClientInfo();
     if (!$clientInfo instanceof ClientInfo) {
         throw new InvalidRequestException('No client info in request');
     }
     $endpointUri = $clientInfo->getUserInfoEndpoint();
     $httpRequest->setUri($endpointUri);
     $httpRequest->setMethod(Http\Request::METHOD_GET);
     $httpRequest->getHeaders()->addHeaders(array($this->authHeaderName => sprintf("%s %s", $this->tokenType, $request->getAccessToken())));
     return $httpRequest;
 }