Skip to content

Commit

Permalink
Move redirect uri in test to a const
Browse files Browse the repository at this point in the history
  • Loading branch information
Sephster committed Feb 22, 2023
1 parent 0d8367e commit f6b884e
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 100 deletions.
7 changes: 4 additions & 3 deletions tests/AuthorizationServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
class AuthorizationServerTest extends TestCase
{
const DEFAULT_SCOPE = 'basic';
const REDIRECT_URI = 'https://foo/bar';

public function setUp(): void
{
Expand Down Expand Up @@ -86,7 +87,7 @@ public function testRespondToRequest()
$client = new ClientEntity();

$client->setConfidential();
$client->setRedirectUri('http://foo/bar');
$client->setRedirectUri(self::REDIRECT_URI);

$clientRepository = $this->getMockBuilder(ClientRepositoryInterface::class)->getMock();
$clientRepository->method('getClientEntity')->willReturn($client);
Expand Down Expand Up @@ -246,7 +247,7 @@ public function testCompleteAuthorizationRequest()
$server->enableGrantType($grant);

$client = new ClientEntity();
$client->setRedirectUri('https://foo/bar');
$client->setRedirectUri(self::REDIRECT_URI);

$authRequest = new AuthorizationRequest();
$authRequest->setAuthorizationApproved(true);
Expand All @@ -263,7 +264,7 @@ public function testCompleteAuthorizationRequest()
public function testValidateAuthorizationRequest()
{
$client = new ClientEntity();
$client->setRedirectUri('http://foo/bar');
$client->setRedirectUri(self::REDIRECT_URI);
$client->setConfidential();
$clientRepositoryMock = $this->getMockBuilder(ClientRepositoryInterface::class)->getMock();
$clientRepositoryMock->method('getClientEntity')->willReturn($client);
Expand Down
Loading

0 comments on commit f6b884e

Please sign in to comment.