Move OAuthServerExceptionTest to appropriate folder

This commit is contained in:
Andrew Millington 2018-05-25 10:00:21 +01:00
parent 68c9fbd83c
commit e4a7fea834
No known key found for this signature in database
GPG Key ID: 077754CA23023F4F

View File

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