Skip to content

Commit 8d522b2

Browse files
committed
bug #219 Remove useless BC layer (ajgarlag)
This PR was merged into the 0.10-dev branch. Discussion ---------- Remove useless BC layer Erroneously introduced in #209 Commits ------- 7d13479 Remove useless BC layer
2 parents 6906009 + 7d13479 commit 8d522b2

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

tests/Fixtures/FixtureFactory.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use League\Bundle\OAuth2ServerBundle\ValueObject\Grant;
1717
use League\Bundle\OAuth2ServerBundle\ValueObject\RedirectUri;
1818
use League\Bundle\OAuth2ServerBundle\ValueObject\Scope;
19-
use League\OAuth2\Server\RequestTypes\AuthorizationRequestInterface;
2019

2120
/**
2221
* Development hints:
@@ -144,15 +143,15 @@ private static function createAccessTokens(ScopeManagerInterface $scopeManager,
144143
self::FIXTURE_ACCESS_TOKEN_PUBLIC,
145144
new \DateTimeImmutable('+1 hour'),
146145
$clientManager->find(self::FIXTURE_CLIENT_FIRST),
147-
interface_exists(AuthorizationRequestInterface::class) ? self::FIXTURE_CLIENT_FIRST : null,
146+
self::FIXTURE_CLIENT_FIRST,
148147
[]
149148
);
150149

151150
$accessTokens[] = (new AccessToken(
152151
self::FIXTURE_ACCESS_TOKEN_WITH_SCOPES,
153152
new \DateTimeImmutable('+1 hour'),
154153
$clientManager->find(self::FIXTURE_CLIENT_FIRST),
155-
interface_exists(AuthorizationRequestInterface::class) ? self::FIXTURE_CLIENT_FIRST : null,
154+
self::FIXTURE_CLIENT_FIRST,
156155
[$scopeManager->find(self::FIXTURE_SCOPE_FIRST)]
157156
));
158157

tests/Integration/ResourceServerTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use League\Bundle\OAuth2ServerBundle\Tests\Fixtures\FixtureFactory;
88
use League\Bundle\OAuth2ServerBundle\Tests\TestHelper;
9-
use League\OAuth2\Server\RequestTypes\AuthorizationRequestInterface;
109

1110
final class ResourceServerTest extends AbstractIntegrationTest
1211
{
@@ -35,7 +34,7 @@ public function testValidAccessToken(): void
3534

3635
$this->assertSame(FixtureFactory::FIXTURE_ACCESS_TOKEN_PUBLIC, $request->getAttribute('oauth_access_token_id'));
3736
$this->assertSame(FixtureFactory::FIXTURE_CLIENT_FIRST, $request->getAttribute('oauth_client_id'));
38-
$this->assertSame(interface_exists(AuthorizationRequestInterface::class) ? FixtureFactory::FIXTURE_CLIENT_FIRST : '', $request->getAttribute('oauth_user_id'));
37+
$this->assertSame(FixtureFactory::FIXTURE_CLIENT_FIRST, $request->getAttribute('oauth_user_id'));
3938
$this->assertSame([], $request->getAttribute('oauth_scopes'));
4039
}
4140

@@ -51,7 +50,7 @@ public function testValidAccessTokenWithScopes(): void
5150

5251
$this->assertSame(FixtureFactory::FIXTURE_ACCESS_TOKEN_WITH_SCOPES, $request->getAttribute('oauth_access_token_id'));
5352
$this->assertSame(FixtureFactory::FIXTURE_CLIENT_FIRST, $request->getAttribute('oauth_client_id'));
54-
$this->assertSame(interface_exists(AuthorizationRequestInterface::class) ? FixtureFactory::FIXTURE_CLIENT_FIRST : '', $request->getAttribute('oauth_user_id'));
53+
$this->assertSame(FixtureFactory::FIXTURE_CLIENT_FIRST, $request->getAttribute('oauth_user_id'));
5554
$this->assertSame([FixtureFactory::FIXTURE_SCOPE_FIRST], $request->getAttribute('oauth_scopes'));
5655
}
5756

0 commit comments

Comments
 (0)