fix tests for person controller update

This commit is contained in:
Julien Fastré 2022-06-16 21:35:05 +02:00
parent 0cfad13720
commit 832da83b27

View File

@ -11,9 +11,11 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Tests\Controller; namespace Chill\PersonBundle\Tests\Controller;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Test\PrepareClientTrait; use Chill\MainBundle\Test\PrepareClientTrait;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
use Closure; use Closure;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/** /**
@ -55,10 +57,10 @@ final class PersonControllerUpdateTest extends WebTestCase
{ {
self::bootKernel(); self::bootKernel();
$this->em = self::$kernel->getContainer() $this->em = self::$container
->get('doctrine.orm.entity_manager'); ->get(EntityManagerInterface::class);
$center = $this->em->getRepository(\Chill\MainBundle\Entity\Center::class) $center = $this->em->getRepository(Center::class)
->findOneBy(['name' => 'Center A']); ->findOneBy(['name' => 'Center A']);
$this->person = (new Person()) $this->person = (new Person())