From f6ca547fc9b58a1b2ad697743a24aaa0f833fc67 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 10 Dec 2020 10:30:34 +0100 Subject: [PATCH] Fix tests --- tests/Wallabag/CoreBundle/WallabagCoreTestCase.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php b/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php index c0fd6ea53..a4cd83e4a 100644 --- a/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php +++ b/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php @@ -89,6 +89,11 @@ abstract class WallabagCoreTestCase extends WebTestCase $firewallName = $container->getParameter('fos_user.firewall_name'); $user = $userManager->findUserBy(['username' => $username]); + + if (null === $user) { + throw new \Exception('Unable to find user "' . $username . '". Does fixtures were loaded?'); + } + $loginManager->logInUser($firewallName, $user); $session->set('_security_' . $firewallName, serialize($container->get('security.token_storage')->getToken()));