Remove the tearDown method, because we are not able to delete entities linked with materialized views

This commit is contained in:
Julien Fastré 2024-04-04 23:00:27 +02:00
parent e5e9ba6d31
commit 1ee3b9e2f0
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -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();