Skip to content

Commit 0e69264

Browse files
committed
Merge branch '5.3' into 5.4
* 5.3: [Ldap] Avoid calling the deprecated getUsername() Report the correct package in the deprecation message Wrapping exception js in Sfjs check and also loading base_js Sfjs if needed Fix PHP 8.1 deprecations Add missing deprecation entry [VarDumper] Don't pass null to parse_url() Invalid copy-paste fix
2 parents 3838c09 + b625789 commit 0e69264

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Security/LdapUser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getSalt(): ?string
7676
*/
7777
public function getUsername(): string
7878
{
79-
trigger_deprecation('symfony/security-core', '5.3', 'Method "%s()" is deprecated and will be removed in 6.0, use getUserIdentifier() instead.', __METHOD__);
79+
trigger_deprecation('symfony/ldap', '5.3', 'Method "%s()" is deprecated and will be removed in 6.0, use getUserIdentifier() instead.', __METHOD__);
8080

8181
return $this->username;
8282
}
@@ -121,7 +121,7 @@ public function isEqualTo(UserInterface $user): bool
121121
return false;
122122
}
123123

124-
if ($this->getUsername() !== $user->getUsername()) {
124+
if ($this->getUserIdentifier() !== $user->getUserIdentifier()) {
125125
return false;
126126
}
127127

Tests/Security/CheckLdapCredentialsListenerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ public function testBindFailureShouldThrowAnException()
138138
$this->expectException(BadCredentialsException::class);
139139
$this->expectExceptionMessage('The presented password is invalid.');
140140

141+
$this->ldap->method('escape')->willReturnArgument(0);
141142
$this->ldap->expects($this->any())->method('bind')->willThrowException(new ConnectionException());
142143

143144
$listener = $this->createListener();
@@ -178,6 +179,7 @@ public function testEmptyQueryResultShouldThrowAnException()
178179
->withConsecutive(
179180
['elsa', 'test1234A$']
180181
);
182+
$this->ldap->method('escape')->willReturnArgument(0);
181183
$this->ldap->expects($this->once())->method('query')->willReturn($query);
182184

183185
$listener = $this->createListener();

0 commit comments

Comments
 (0)