From d55311ce401aa4c3ba32def2f6f47016434cf51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 16 Jun 2022 23:19:16 +0200 Subject: [PATCH] try to block removing a person --- .../Tests/Controller/PersonControllerCreateTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php index 11f1ee43d..2d4032dc3 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php @@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Tests\Controller; use Chill\MainBundle\Test\PrepareClientTrait; use DateTime; +use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DomCrawler\Form; @@ -48,21 +49,21 @@ final class PersonControllerCreateTest extends WebTestCase public static function tearDownAfterClass(): void { self::bootKernel(); - $em = self::$kernel->getContainer()->get('doctrine.orm.entity_manager'); + $em = self::$kernel->getContainer()->get(EntityManagerInterface::class); //remove two people created during test $jesus = $em->getRepository(\Chill\PersonBundle\Entity\Person::class) ->findOneBy(['firstName' => 'God']); if (null !== $jesus) { - $em->remove($jesus); + //$em->remove($jesus); } $jesus2 = $em->getRepository(\Chill\PersonBundle\Entity\Person::class) ->findOneBy(['firstName' => 'roger']); if (null !== $jesus2) { - $em->remove($jesus2); + //$em->remove($jesus2); } $em->flush(); }