From 1ee3b9e2f0f23f01e163a70832892f0195cd9c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 4 Apr 2024 23:00:27 +0200 Subject: [PATCH] Remove the tearDown method, because we are not able to delete entities linked with materialized views --- .../Controller/HouseholdApiControllerTest.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php index 03b5a5576..acc2a09e9 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php @@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Tests\Controller; use Chill\MainBundle\Entity\Address; use Chill\MainBundle\Entity\AddressReference; use Chill\MainBundle\Entity\Center; +use Chill\MainBundle\Entity\User; use Chill\MainBundle\Test\PrepareClientTrait; use Chill\PersonBundle\Entity\Household\Household; use Chill\PersonBundle\Entity\Household\HouseholdMember; @@ -33,22 +34,6 @@ final class HouseholdApiControllerTest extends WebTestCase private static array $toDelete = []; - protected function tearDown(): void - { - self::bootKernel(); - - $em = self::getContainer()->get(EntityManagerInterface::class); - - foreach (self::$toDelete as [$class, $id]) { - $obj = $em->getRepository($class)->find($id); - $em->remove($obj); - } - - $em->flush(); - self::$toDelete = []; - self::ensureKernelShutdown(); - } - public static function generateHouseholdAssociatedWithAddressReference() { self::bootKernel();