Add hasRedirect() method for OAuthServerException

Resolves #694.
This commit is contained in:
Ian Littman
2017-02-04 14:48:40 -05:00
parent ded7c1ed47
commit d8ece093d5
2 changed files with 30 additions and 0 deletions

17
tests/ExceptionTest.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
namespace LeagueTests\Utils;
use League\OAuth2\Server\Exception\OAuthServerException;
class ExceptionTest extends \PHPUnit_Framework_TestCase
{
public function testHasRedirect()
{
$exceptionWithoutRedirect = OAuthServerException::accessDenied('Some hint');
$this->assertFalse($exceptionWithoutRedirect->hasRedirect());
$exceptionWithRedirect = OAuthServerException::accessDenied('some hint', 'https://example.com/error');
$this->assertTrue($exceptionWithRedirect->hasRedirect());
}
}