Skip to content

Commit 5d34d5a

Browse files
authored
Merge pull request #264 from ajgarlag/remove-legacy
Remove legacy stuff
2 parents 12d61b0 + 1800864 commit 5d34d5a

File tree

3 files changed

+4
-54
lines changed

3 files changed

+4
-54
lines changed

.gitattributes

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
/tests export-ignore
2-
/dev export-ignore
3-
/.github export-ignore
41
/.editorconfig export-ignore
52
/.gitattributes export-ignore
3+
/.github export-ignore
64
/.gitignore export-ignore
7-
/.php-cs-fixer.dist export-ignore
8-
/docker-compose.yml export-ignore
5+
/.php-cs-fixer.dist.php export-ignore
96
/phpunit.xml.dist export-ignore
10-
/.psalm.baseline.xml export-ignore
11-
/psalm.xml export-ignore
7+
/phpstan.dist.neon export-ignore
8+
/tests export-ignore

compose.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/Unit/OAuth2AuthenticatorTest.php

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Symfony\Component\Security\Core\User\UserProviderInterface;
2020
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
2121
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
22-
use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface;
2322
use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport;
2423

2524
final class OAuth2AuthenticatorTest extends TestCase
@@ -132,41 +131,6 @@ public function testAuthenticateCreatePassportWithClientCredentialsUser(): void
132131
$this->assertInstanceOf(ClientCredentialsUser::class, $passport->getUser());
133132
}
134133

135-
/**
136-
* @group legacy
137-
*/
138-
public function testCreateAuthenticatedToken(): void
139-
{
140-
if (!interface_exists(PassportInterface::class)) {
141-
$this->markTestSkipped('Irrelevant on Symfony 6+');
142-
}
143-
144-
$userBadge = new UserBadge('oauthClientId', static function (): UserInterface {
145-
return new ClientCredentialsUser('oauthClientId');
146-
});
147-
148-
$passport = new SelfValidatingPassport($userBadge, [
149-
new ScopeBadge(['scope_one', 'scope_two']),
150-
]);
151-
$passport->setAttribute('accessTokenId', 'accessTokenId');
152-
$passport->setAttribute('oauthClientId', 'oauthClientId');
153-
154-
$authenticator = new OAuth2Authenticator(
155-
$this->createMock(HttpMessageFactoryInterface::class),
156-
$this->createMock(ResourceServer::class),
157-
$this->createMock(TestUserProvider::class),
158-
'PREFIX_'
159-
);
160-
161-
$token = $authenticator->createAuthenticatedToken($passport, 'firewallName');
162-
163-
$this->assertSame(['scope_one', 'scope_two'], $token->getScopes());
164-
$this->assertSame('accessTokenId', $token->getCredentials());
165-
$this->assertInstanceOf(ClientCredentialsUser::class, $token->getUser());
166-
$this->assertSame('oauthClientId', $token->getUser()->getUserIdentifier());
167-
$this->assertTrue($token->isAuthenticated());
168-
}
169-
170134
public function testCreateToken(): void
171135
{
172136
$userBadge = new UserBadge('userIdentifier', static function (): UserInterface {

0 commit comments

Comments
 (0)