From d53abc661c525b3785c5516df6e6f9f2a21b8203 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Wed, 27 Mar 2013 14:27:06 +0000 Subject: [PATCH] getExceptionHttpHeaders() unit tests --- tests/authorization/AuthServerTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/authorization/AuthServerTest.php b/tests/authorization/AuthServerTest.php index 0158b887..8b4c7bbe 100644 --- a/tests/authorization/AuthServerTest.php +++ b/tests/authorization/AuthServerTest.php @@ -50,6 +50,14 @@ class Authorization_Server_test extends PHPUnit_Framework_TestCase $this->assertEquals('access_denied', OAuth2\AuthServer::getExceptionType(2)); } + public function test_getExceptionHttpHeaders() + { + $this->assertEquals(array('HTTP/1.1 401 Unauthorized'), OAuth2\AuthServer::getExceptionHttpHeaders('access_denied')); + $this->assertEquals(array('HTTP/1.1 500 Internal Server Error'), OAuth2\AuthServer::getExceptionHttpHeaders('server_error')); + $this->assertEquals(array('HTTP/1.1 501 Not Implemented'), OAuth2\AuthServer::getExceptionHttpHeaders('unsupported_grant_type')); + $this->assertEquals(array('HTTP/1.1 400 Bad Request'), OAuth2\AuthServer::getExceptionHttpHeaders('invalid_refresh')); + } + public function test_hasGrantType() { $a = $this->returnDefault();