mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 02:25:00 +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:
@@ -86,18 +86,18 @@ final class PersonContextTest extends KernelTestCase
|
||||
// prophecy for other dependencies)
|
||||
$context = $this->buildPersonContext(
|
||||
null,
|
||||
self::$container->get(BaseContextData::class),
|
||||
self::$container->get(CenterResolverManagerInterface::class),
|
||||
self::$container->get(DocumentCategoryRepository::class),
|
||||
self::$container->get(EntityManagerInterface::class),
|
||||
self::$container->get(NormalizerInterface::class),
|
||||
self::getContainer()->get(BaseContextData::class),
|
||||
self::getContainer()->get(CenterResolverManagerInterface::class),
|
||||
self::getContainer()->get(DocumentCategoryRepository::class),
|
||||
self::getContainer()->get(EntityManagerInterface::class),
|
||||
self::getContainer()->get(NormalizerInterface::class),
|
||||
new ParameterBag(['chill_main' => ['acl' => ['form_show_scopes' => false]]]),
|
||||
null,
|
||||
self::$container->get(Security::class),
|
||||
self::getContainer()->get(Security::class),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
self::$container->get(ThirdPartyRepository::class)
|
||||
self::getContainer()->get(ThirdPartyRepository::class)
|
||||
);
|
||||
$template = new DocGeneratorTemplate();
|
||||
$template->setName(['fr' => 'test'])->setContext(AccompanyingPeriodContext::class)
|
||||
@@ -118,7 +118,7 @@ final class PersonContextTest 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)
|
||||
@@ -136,7 +136,7 @@ final class PersonContextTest extends KernelTestCase
|
||||
throw new \RuntimeException('No confirmed period in database');
|
||||
}
|
||||
|
||||
$category = self::$container->get(DocumentCategoryRepository::class)
|
||||
$category = self::getContainer()->get(DocumentCategoryRepository::class)
|
||||
->findAll()[0];
|
||||
|
||||
if (null === $category) {
|
||||
|
Reference in New Issue
Block a user