Skip to content

Commit a941745

Browse files
committed
Add missing authenticator dependency injection argument
1 parent 7c5a57c commit a941745

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

DependencyInjection/Security/Factory/OAuthFactory.php

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function createAuthenticator(ContainerBuilder $container, string $id, arr
3838
->replaceArgument(0, new Reference('fos_oauth_server.server'))
3939
->replaceArgument(1, new Reference('security.token_storage'))
4040
->replaceArgument(2, new Reference('security.user_checker.'.$id))
41+
->replaceArgument(3, new Reference($userProviderId))
4142
;
4243

4344
return $providerId;

Tests/DependencyInjection/Security/Factory/OAuthFactoryTest.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ public function testCreateAuthenticator(): void
124124
;
125125
$id = '12';
126126
$config = [];
127+
$userProviderId = 'mock.user.provider.service';
127128

128129
$definition = $this->getMockBuilder(Definition::class)
129130
->disableOriginalConstructor()
@@ -141,7 +142,7 @@ public function testCreateAuthenticator(): void
141142
;
142143

143144
$definition
144-
->expects($this->exactly(3))
145+
->expects($this->exactly(4))
145146
->method('replaceArgument')
146147
->withConsecutive(
147148
[
@@ -155,9 +156,14 @@ public function testCreateAuthenticator(): void
155156
[
156157
2,
157158
new Reference('security.user_checker.'.$id),
159+
],
160+
[
161+
3,
162+
new Reference($userProviderId),
158163
]
159164
)
160165
->willReturnOnConsecutiveCalls(
166+
$definition,
161167
$definition,
162168
$definition,
163169
$definition
@@ -166,7 +172,7 @@ public function testCreateAuthenticator(): void
166172

167173
$this->assertSame(
168174
'fos_oauth_server.security.authentication.authenticator.'.$id,
169-
$this->instance->createAuthenticator($container, $id, $config, 'ignored.user.provider.service')
175+
$this->instance->createAuthenticator($container, $id, $config, $userProviderId)
170176
);
171177
}
172178

0 commit comments

Comments
 (0)