mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Remove the tearDown method, because we are not able to delete entities linked with materialized views
This commit is contained in:
parent
e5e9ba6d31
commit
1ee3b9e2f0
@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Tests\Controller;
|
|||||||
use Chill\MainBundle\Entity\Address;
|
use Chill\MainBundle\Entity\Address;
|
||||||
use Chill\MainBundle\Entity\AddressReference;
|
use Chill\MainBundle\Entity\AddressReference;
|
||||||
use Chill\MainBundle\Entity\Center;
|
use Chill\MainBundle\Entity\Center;
|
||||||
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Test\PrepareClientTrait;
|
use Chill\MainBundle\Test\PrepareClientTrait;
|
||||||
use Chill\PersonBundle\Entity\Household\Household;
|
use Chill\PersonBundle\Entity\Household\Household;
|
||||||
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
||||||
@ -33,22 +34,6 @@ final class HouseholdApiControllerTest extends WebTestCase
|
|||||||
|
|
||||||
private static array $toDelete = [];
|
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()
|
public static function generateHouseholdAssociatedWithAddressReference()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user