mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 13:54:59 +00:00
Replaced the deprecated 'self::$container->get' with 'self::getContainer()->get' using rector
This change is made to comply with the new Symfony standards and to avoid deprecation warnings for future versions. The update touches various functionalities, including retrieving EntityManagerInterface instance and various service classes within the test files.
This commit is contained in:
@@ -54,7 +54,7 @@ final class PersonControllerUpdateTest extends WebTestCase
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
foreach (self::$toDelete as [$class, $id]) {
|
||||
$entity = $em->find($class, $id);
|
||||
@@ -124,7 +124,7 @@ final class PersonControllerUpdateTest extends WebTestCase
|
||||
|
||||
self::assertResponseRedirects($this->makeViewPath($personId));
|
||||
|
||||
$person = self::$container->get(PersonRepository::class)->find($personId);
|
||||
$person = self::getContainer()->get(PersonRepository::class)->find($personId);
|
||||
|
||||
self::assertEquals('tagada', $person->getFirstName());
|
||||
}
|
||||
@@ -156,8 +156,8 @@ final class PersonControllerUpdateTest extends WebTestCase
|
||||
public static function providePerson(): iterable
|
||||
{
|
||||
self::bootKernel();
|
||||
$centerRepository = self::$container->get(CenterRepositoryInterface::class);
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$centerRepository = self::getContainer()->get(CenterRepositoryInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
$center = $centerRepository->findOneBy(['name' => 'Center A']);
|
||||
|
||||
$person = new Person();
|
||||
|
Reference in New Issue
Block a user