Lots of fixes for tests following exceptions changes

This commit is contained in:
Alex Bilbie
2014-05-01 14:33:11 +01:00
parent 9f1f0cc3bc
commit 1183fe80c6
8 changed files with 47 additions and 111 deletions

View File

@@ -13,7 +13,7 @@ class ClientCredentialsTest extends \PHPUnit_Framework_TestCase
{
function testCompleteFlowMissingClientId()
{
$this->setExpectedException('League\OAuth2\Server\Exception\ClientException', 'The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "client_id" parameter.');
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidRequestException');
$_POST['grant_type'] = 'client_credentials';
@@ -27,7 +27,7 @@ class ClientCredentialsTest extends \PHPUnit_Framework_TestCase
function testCompleteFlowMissingClientSecret()
{
$this->setExpectedException('League\OAuth2\Server\Exception\ClientException', 'The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "client_secret" parameter.');
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidRequestException');
$_POST = [
'grant_type' => 'client_credentials',
@@ -43,7 +43,7 @@ class ClientCredentialsTest extends \PHPUnit_Framework_TestCase
function testCompleteFlowInvalidClient()
{
$this->setExpectedException('League\OAuth2\Server\Exception\ClientException', 'Client authentication failed');
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidClientException');
$_POST = [
'grant_type' => 'client_credentials',
@@ -66,7 +66,7 @@ class ClientCredentialsTest extends \PHPUnit_Framework_TestCase
function testCompleteFlowInvalidScope()
{
$this->setExpectedException('League\OAuth2\Server\Exception\ClientException', 'The requested scope is invalid, unknown, or malformed. Check the "foo" scope.');
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidScopeException');
$_POST = [
'grant_type' => 'client_credentials',