From ecad2b98ae1336e7263cdf4dabdd687fb8a827fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Guti=C3=A9rrez?= Date: Fri, 11 Mar 2016 00:23:29 +0100 Subject: [PATCH] update invalid grant type test --- tests/ServerTest.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/ServerTest.php b/tests/ServerTest.php index 74d88740..66eadc27 100644 --- a/tests/ServerTest.php +++ b/tests/ServerTest.php @@ -33,9 +33,12 @@ class ServerTest extends \PHPUnit_Framework_TestCase $server->enableGrantType(new ClientCredentialsGrant(), new \DateInterval('PT1M')); - $response = $server->respondToRequest(); - $this->assertTrue($response instanceof ResponseInterface); - $this->assertEquals(400, $response->getStatusCode()); + try { + $server->respondToRequest(); + } catch (OAuthServerException $e) { + $this->assertEquals('unsupported_grant_type', $e->getErrorType()); + $this->assertEquals(400, $e->getHttpStatusCode()); + } } public function testRespondToRequest()