Skip to content

Commit

Permalink
Add missing authenticator dependency injection argument
Browse files Browse the repository at this point in the history
  • Loading branch information
iisisrael committed Sep 1, 2022
1 parent 68851da commit 5059e4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions DependencyInjection/Security/Factory/OAuthFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function createAuthenticator(ContainerBuilder $container, string $id, arr
->replaceArgument(0, new Reference('fos_oauth_server.server'))
->replaceArgument(1, new Reference('security.token_storage'))
->replaceArgument(2, new Reference('security.user_checker.'.$id))
->replaceArgument(3, new Reference($userProviderId))
;

return $providerId;
Expand Down
10 changes: 8 additions & 2 deletions Tests/DependencyInjection/Security/Factory/OAuthFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public function testCreateAuthenticator(): void
;
$id = '12';
$config = [];
$userProviderId = 'mock.user.provider.service';

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

$definition
->expects($this->exactly(3))
->expects($this->exactly(4))
->method('replaceArgument')
->withConsecutive(
[
Expand All @@ -155,9 +156,14 @@ public function testCreateAuthenticator(): void
[
2,
new Reference('security.user_checker.'.$id),
],
[
3,
new Reference($userProviderId),
]
)
->willReturnOnConsecutiveCalls(
$definition,
$definition,
$definition,
$definition
Expand All @@ -166,7 +172,7 @@ public function testCreateAuthenticator(): void

$this->assertSame(
'fos_oauth_server.security.authentication.authenticator.'.$id,
$this->instance->createAuthenticator($container, $id, $config, 'ignored.user.provider.service')
$this->instance->createAuthenticator($container, $id, $config, $userProviderId)
);
}

Expand Down

0 comments on commit 5059e4c

Please sign in to comment.