mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-01 17:38:38 +00:00
Use test container to replace test services definitions
This commit is contained in:
parent
742742f67d
commit
a221ec8348
7 changed files with 16 additions and 32 deletions
|
@ -132,7 +132,7 @@ class DeveloperControllerTest extends WallabagTestCase
|
|||
{
|
||||
$client = $this->getTestClient();
|
||||
$em = $client->getContainer()->get(EntityManagerInterface::class);
|
||||
$userManager = $client->getContainer()->get('fos_user.user_manager.test');
|
||||
$userManager = static::getContainer()->get('fos_user.user_manager');
|
||||
$user = $userManager->findUserBy(['username' => $username]);
|
||||
$apiClient = new Client($user);
|
||||
$apiClient->setName('My app');
|
||||
|
|
|
@ -43,10 +43,10 @@ abstract class WallabagApiTestCase extends WebTestCase
|
|||
protected function createAuthorizedClient()
|
||||
{
|
||||
$client = $this->createUnauthorizedClient();
|
||||
$container = $client->getContainer();
|
||||
$container = static::getContainer();
|
||||
|
||||
/** @var UserManager $userManager */
|
||||
$userManager = $container->get('fos_user.user_manager.test');
|
||||
$userManager = $container->get('fos_user.user_manager');
|
||||
$firewallName = $container->getParameter('fos_user.firewall_name');
|
||||
|
||||
$this->user = $userManager->findUserBy(['username' => 'admin']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue