Fix tests

This commit is contained in:
Jeremy Benoist 2020-12-10 10:30:34 +01:00
parent 5af3c573bd
commit f6ca547fc9
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C

View file

@ -89,6 +89,11 @@ abstract class WallabagCoreTestCase extends WebTestCase
$firewallName = $container->getParameter('fos_user.firewall_name'); $firewallName = $container->getParameter('fos_user.firewall_name');
$user = $userManager->findUserBy(['username' => $username]); $user = $userManager->findUserBy(['username' => $username]);
if (null === $user) {
throw new \Exception('Unable to find user "' . $username . '". Does fixtures were loaded?');
}
$loginManager->logInUser($firewallName, $user); $loginManager->logInUser($firewallName, $user);
$session->set('_security_' . $firewallName, serialize($container->get('security.token_storage')->getToken())); $session->set('_security_' . $firewallName, serialize($container->get('security.token_storage')->getToken()));