mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-07-17 22:36:14 +00:00
try to block removing a person
This commit is contained in:
parent
07608dc412
commit
d55311ce40
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user