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

@@ -33,7 +33,7 @@ class NewsItemsHistoryControllerTest extends WebTestCase
public static function tearDownAfterClass(): void
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
foreach (static::$toDelete as [$class, $entity]) {
$query = $em->createQuery(sprintf('DELETE FROM %s e WHERE e.id = :id', $class))
@@ -54,7 +54,7 @@ class NewsItemsHistoryControllerTest extends WebTestCase
public static function generateNewsItemIds(): iterable
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$news = new NewsItem();