Ejemplo n.º 1
0
 public function testAddAuthorizationsUnsupportedScope()
 {
     $h = new HttpRequest("http://www.example.org/api.php");
     $h->setRequestMethod("POST");
     $h->setPathInfo("/authorizations/");
     $h->setHeader("Authorization", "Bearer 12345abc");
     $h->setContent(Json::enc(array("client_id" => "testcodeclient", "scope" => "UNSUPPORTED SCOPE")));
     $response = $this->_api->handleRequest($h);
     $this->assertEquals(400, $response->getStatusCode());
     $this->assertEquals('{"error":"invalid_request","error_description":"invalid scope for this client"}', $response->getContent());
 }