mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-15 09:47:46 +05:30
Test OAuthExceptin
This commit is contained in:
parent
49650d1ae9
commit
7e0115f0ad
25
tests/Exception/OAuthExceptionTest.php
Normal file
25
tests/Exception/OAuthExceptionTest.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace LeagueTests;
|
||||||
|
|
||||||
|
use \Mockery as M;
|
||||||
|
|
||||||
|
class OAuthExceptionTest extends \PHPUnit_Framework_TestCase
|
||||||
|
{
|
||||||
|
public function testGetHttpHeaders()
|
||||||
|
{
|
||||||
|
$exception = new \League\OAuth2\Server\Exception\OAuthException();
|
||||||
|
|
||||||
|
$exception->httpStatusCode = 400;
|
||||||
|
$this->assertSame($exception->getHttpHeaders(), ['HTTP/1.1 400 Bad Request']);
|
||||||
|
|
||||||
|
$exception->httpStatusCode = 401;
|
||||||
|
$this->assertSame($exception->getHttpHeaders(), ['HTTP/1.1 401 Unauthorized']);
|
||||||
|
|
||||||
|
$exception->httpStatusCode = 500;
|
||||||
|
$this->assertSame($exception->getHttpHeaders(), ['HTTP/1.1 500 Internal Server Error']);
|
||||||
|
|
||||||
|
$exception->httpStatusCode = 501;
|
||||||
|
$this->assertSame($exception->getHttpHeaders(), ['HTTP/1.1 501 Not Implemented']);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user