diff --git a/src/Bundle/ChillMainBundle/Test/PrepareClientTrait.php b/src/Bundle/ChillMainBundle/Test/PrepareClientTrait.php index 619436269..57c87f6bf 100644 --- a/src/Bundle/ChillMainBundle/Test/PrepareClientTrait.php +++ b/src/Bundle/ChillMainBundle/Test/PrepareClientTrait.php @@ -31,6 +31,7 @@ trait PrepareClientTrait public function getClientAuthenticated( $username = 'center a_social', $password = 'password', + $firewall = 'chill_main', ): KernelBrowser { if ('admin' === $username) { return $this->getClientAuthenticatedAsAdmin(); @@ -49,12 +50,12 @@ trait PrepareClientTrait throw new \RuntimeException(sprintf('user with username or email %s not found', $username)); } - $client->loginUser($user); + $client->loginUser($user, $firewall); return $client; } - public function getClientAuthenticatedAsAdmin(): KernelBrowser + public function getClientAuthenticatedAsAdmin(string $firewall = 'chill_main'): KernelBrowser { if (!$this instanceof WebTestCase) { throw new \LogicException(sprintf('The current class does not implements %s', WebTestCase::class)); @@ -63,9 +64,9 @@ trait PrepareClientTrait $client = static::createClient(); /** @var \Symfony\Component\Security\Core\User\InMemoryUserProvider $userProvider */ - $userProvider = static::getContainer()->get('security.user.provider.concrete.in_memory'); + $userProvider = static::getContainer()->get('security.user.provider.concrete.chill_in_memory'); $user = $userProvider->loadUserByIdentifier('admin'); - $client->loginUser($user); + $client->loginUser($user, $firewall); return $client; }