Skip to content

Commit dda84ef

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: Fix test [Ldap] Add missing security-http dependency [SecurityBundle] There is no Guard 6 Guard is incompatible with Symfony 6 [Tests] Remove some unused fixtures
2 parents d9bc276 + f74eaaf commit dda84ef

File tree

2 files changed

+22
-34
lines changed

2 files changed

+22
-34
lines changed

Tests/Security/CheckLdapCredentialsListenerTest.php

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ class CheckLdapCredentialsListenerTest extends TestCase
4040

4141
protected function setUp(): void
4242
{
43-
if (!interface_exists(AuthenticatorInterface::class)) {
44-
$this->markTestSkipped('This test requires symfony/security-http:^5.1');
45-
}
46-
4743
$this->ldap = $this->createMock(LdapInterface::class);
4844
}
4945

@@ -60,10 +56,6 @@ public function testShouldNotCheckPassport($authenticator, $passport)
6056

6157
public function provideShouldNotCheckPassport()
6258
{
63-
if (!interface_exists(AuthenticatorInterface::class)) {
64-
$this->markTestSkipped('This test requires symfony/security-http:^5.1');
65-
}
66-
6759
// no LdapBadge
6860
yield [new TestAuthenticator(), new Passport(new UserBadge('test'), new PasswordCredentials('s3cret'))];
6961

@@ -109,10 +101,6 @@ public function testWrongPassport($passport)
109101

110102
public function provideWrongPassportData()
111103
{
112-
if (!interface_exists(AuthenticatorInterface::class)) {
113-
$this->markTestSkipped('This test requires symfony/security-http:^5.1');
114-
}
115-
116104
// no password credentials
117105
yield [new SelfValidatingPassport(new UserBadge('test'), [new LdapBadge('app.ldap')])];
118106
}
@@ -204,31 +192,29 @@ private function createListener()
204192
}
205193
}
206194

207-
if (interface_exists(AuthenticatorInterface::class)) {
208-
class TestAuthenticator implements AuthenticatorInterface
195+
class TestAuthenticator implements AuthenticatorInterface
196+
{
197+
public function supports(Request $request): ?bool
209198
{
210-
public function supports(Request $request): ?bool
211-
{
212-
}
199+
}
213200

214-
public function authenticate(Request $request): Passport
215-
{
216-
}
201+
public function authenticate(Request $request): Passport
202+
{
203+
}
217204

218-
public function createAuthenticatedToken(Passport $passport, string $firewallName): TokenInterface
219-
{
220-
}
205+
public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface
206+
{
207+
}
221208

222-
public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
223-
{
224-
}
209+
public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
210+
{
211+
}
225212

226-
public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response
227-
{
228-
}
213+
public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response
214+
{
215+
}
229216

230-
public function createToken(Passport $passport, string $firewallName): TokenInterface
231-
{
232-
}
217+
public function createToken(Passport $passport, string $firewallName): TokenInterface
218+
{
233219
}
234220
}

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121
"symfony/options-resolver": "^5.4|^6.0"
2222
},
2323
"require-dev": {
24-
"symfony/security-core": "^5.4|^6.0"
24+
"symfony/security-core": "^5.4|^6.0",
25+
"symfony/security-http": "^5.4|^6.0"
2526
},
2627
"conflict": {
2728
"symfony/options-resolver": "<5.4",
28-
"symfony/security-core": "<5.4"
29+
"symfony/security-core": "<5.4",
30+
"symfony/security-http": "<5.4"
2931
},
3032
"autoload": {
3133
"psr-4": { "Symfony\\Component\\Ldap\\": "" },

0 commit comments

Comments
 (0)