fix container operations within tests

This commit is contained in:
2024-04-04 22:26:42 +02:00
parent 92800f5dd0
commit 553fb271e4
6 changed files with 12 additions and 12 deletions

View File

@@ -35,9 +35,9 @@ class ListActivitiesByAccompanyingPeriodContextTest extends KernelTestCase
protected function setUp(): void
{
self::bootKernel();
$this->listActivitiesByAccompanyingPeriodContext = self::$container->get(ListActivitiesByAccompanyingPeriodContext::class);
$this->accompanyingPeriodRepository = self::$container->get(AccompanyingPeriodRepository::class);
$this->userRepository = self::$container->get(UserRepositoryInterface::class);
$this->listActivitiesByAccompanyingPeriodContext = self::getContainer()->get(ListActivitiesByAccompanyingPeriodContext::class);
$this->accompanyingPeriodRepository = self::getContainer()->get(AccompanyingPeriodRepository::class);
$this->userRepository = self::getContainer()->get(UserRepositoryInterface::class);
}
/**
@@ -101,7 +101,7 @@ class ListActivitiesByAccompanyingPeriodContextTest extends KernelTestCase
public static function provideAccompanyingPeriod(): array
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
if (null === $period = $em->createQuery('SELECT a FROM '.AccompanyingPeriod::class.' a')
->setMaxResults(1)