public function tokenAction()
 {
     $server = $this->getServiceLocator()->get('OAuth2Server\\Server');
     $request = Request::createFromRequest($this->getRequest());
     $response = $server->handleTokenRequest($request, $this->getResponse());
     return new JsonModel($response->getContent());
 }
 public function testRequestHasHeadersMethod()
 {
     $baseRequest = BaseRequest::fromString("GET /index.php HTTP/1.1\r\nAccept: */*\r\n\r\nSome Content");
     $request = Request::createFromRequest($baseRequest);
     $this->assertEquals('Accept: */*', $request->headers('Accept'));
 }