Remove need to pass firewall name to log in in tests

One less usage of parameters in tests
This commit is contained in:
Yassine Guedidi
2025-11-23 00:59:35 +01:00
parent 3c6c0ed74e
commit a2497d9ce8
2 changed files with 2 additions and 4 deletions

View File

@ -46,14 +46,13 @@ abstract class WallabagApiTestCase extends WebTestCase
/** @var UserManager $userManager */
$userManager = $container->get('fos_user.user_manager');
$firewallName = $container->getParameter('fos_user.firewall_name');
$adminUser = $userManager->findUserBy(['username' => 'admin']);
\assert($adminUser instanceof User);
$this->user = $adminUser;
$client->loginUser($adminUser, $firewallName);
$client->loginUser($adminUser);
return $client;
}

View File

@ -53,7 +53,6 @@ abstract class WallabagTestCase extends WebTestCase
$container = static::getContainer();
$userManager = $container->get('fos_user.user_manager');
$firewallName = $container->getParameter('fos_user.firewall_name');
$user = $userManager->findUserBy(['username' => $username]);
@ -61,7 +60,7 @@ abstract class WallabagTestCase extends WebTestCase
throw new \Exception('Unable to find user "' . $username . '". Does fixtures were loaded?');
}
$this->client->loginUser($user, $firewallName);
$this->client->loginUser($user);
}
/**