Exemplo n.º 1
0
 public function testRequestOverride()
 {
     $request = new OAuth2_Request_TestRequest();
     $server = $this->getTestServer();
     // Smoke test for override request class
     // $response = $server->handleGrantRequest($request);
     // $this->assertInstanceOf('OAuth2_Response', $response);
     // $response = $server->handleAuthorizeRequest($request, true);
     // $this->assertInstanceOf('OAuth2_Response', $response);
     // $response = $server->verifyAccessRequest($request);
     // $this->assertTrue(is_bool($response));
     /*** make some valid requests ***/
     // Valid Grant Request
     $request->setQuery(array('grant_type' => 'authorization_code', 'client_id' => 'Test Client ID', 'client_secret' => 'TestSecret', 'code' => 'testcode'));
     $response = $server->handleGrantRequest($request);
     $this->assertEquals($response->getStatusCode(), 200);
     $this->assertNull($response->getParameter('error'));
     $this->assertNotNUll($response->getParameter('access_token'));
 }