mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 11:33:49 +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:
@@ -58,16 +58,16 @@ class AccompanyingPeriodContextTest extends KernelTestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->baseContextData = self::$container->get(BaseContextData::class);
|
||||
$this->documentCategoryRepository = self::$container->get(DocumentCategoryRepository::class);
|
||||
$this->em = self::$container->get(EntityManagerInterface::class);
|
||||
$this->normalizer = self::$container->get(NormalizerInterface::class);
|
||||
$this->personRender = self::$container->get(PersonRenderInterface::class);
|
||||
$this->personRepository = self::$container->get(PersonRepository::class);
|
||||
$this->translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class);
|
||||
$this->translator = self::$container->get(TranslatorInterface::class);
|
||||
$this->thirdPartyRender = self::$container->get(ThirdPartyRender::class);
|
||||
$this->thirdPartyRepository = self::$container->get(ThirdPartyRepository::class);
|
||||
$this->baseContextData = self::getContainer()->get(BaseContextData::class);
|
||||
$this->documentCategoryRepository = self::getContainer()->get(DocumentCategoryRepository::class);
|
||||
$this->em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
$this->normalizer = self::getContainer()->get(NormalizerInterface::class);
|
||||
$this->personRender = self::getContainer()->get(PersonRenderInterface::class);
|
||||
$this->personRepository = self::getContainer()->get(PersonRepository::class);
|
||||
$this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
|
||||
$this->translator = self::getContainer()->get(TranslatorInterface::class);
|
||||
$this->thirdPartyRender = self::getContainer()->get(ThirdPartyRender::class);
|
||||
$this->thirdPartyRepository = self::getContainer()->get(ThirdPartyRepository::class);
|
||||
}
|
||||
|
||||
private function buildContext(): AccompanyingPeriodContext
|
||||
@@ -127,7 +127,7 @@ class AccompanyingPeriodContextTest extends KernelTestCase
|
||||
public function provideNormalizedData(): iterable
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
$thirdParty = $em->createQuery('SELECT t FROM '.ThirdParty::class.' t')
|
||||
->setMaxResults(1)
|
||||
|
Reference in New Issue
Block a user