Skip to content

Commit 4abdd49

Browse files
Merge branch '6.4' into 7.3
* 6.4: [Cache] Fix internal representation of non-static values [Cache] Make `TagAwareAdapter` registrable as a service refactor: Unify & more humane translation message fix Resources translations validators.pt.xlf [Security] Pass attributes to nested `ChainUserProviders` [Validator] Update translation for the Video constraint [Messenger] Firebird Database - incompatibility with expected lowercase columns SQLSRV: Change column type from TEXT to STRING Fix exception catch when deleting temporary table in the sameDatabaseChecker [Serializer] Fix serializer crash due to asymmetric visibility on `protected(set)` properties
2 parents 559a7a5 + 8b7c95b commit 4abdd49

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Tests/User/ChainUserProviderTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ public function testLoadUserByIdentifier()
4949

5050
public function testLoadUserByIdentifierWithAttributes()
5151
{
52+
$provider0 = $this->createMock(ChainUserProvider::class);
53+
$provider0
54+
->expects($this->once())
55+
->method('loadUserByIdentifier')
56+
->with($this->equalTo('foo'), $this->equalTo(['attr' => 5]))
57+
->willThrowException(new UserNotFoundException('not found'))
58+
;
59+
5260
$provider1 = $this->createMock(UserProviderInterface::class);
5361
$provider1
5462
->expects($this->once())
@@ -65,7 +73,7 @@ public function testLoadUserByIdentifierWithAttributes()
6573
->willReturn($account = $this->createMock(UserInterface::class))
6674
;
6775

68-
$provider = new ChainUserProvider([$provider1, $provider2]);
76+
$provider = new ChainUserProvider([$provider0, $provider1, $provider2]);
6977
$this->assertSame($account, $provider->loadUserByIdentifier('foo', ['attr' => 5]));
7078
}
7179

User/ChainUserProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function loadUserByIdentifier(string $identifier/* , array $attributes =
5454
$attributes = \func_num_args() > 1 ? func_get_arg(1) : [];
5555
foreach ($this->providers as $provider) {
5656
try {
57-
if ($provider instanceof AttributesBasedUserProviderInterface) {
57+
if ($provider instanceof AttributesBasedUserProviderInterface || $provider instanceof self) {
5858
return $provider->loadUserByIdentifier($identifier, $attributes);
5959
}
6060

0 commit comments

Comments
 (0)