mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 22:35:01 +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:
@@ -34,13 +34,13 @@ class AccompanyingCourseExportHelperTest extends KernelTestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->em = self::$container->get(EntityManagerInterface::class);
|
||||
$this->em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
foreach (self::$entitiesToDelete as [$class, $id]) {
|
||||
$entity = $em->find($class, $id);
|
||||
|
@@ -210,7 +210,7 @@ final class ExportManagerTest extends KernelTestCase
|
||||
$filters = [];
|
||||
$aggregators = [];
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
$export = $this->prophet->prophesize();
|
||||
$export->willImplement(ExportInterface::class);
|
||||
@@ -313,7 +313,7 @@ final class ExportManagerTest extends KernelTestCase
|
||||
|
||||
// add formatter interface
|
||||
$formatter = new \Chill\MainBundle\Export\Formatter\SpreadSheetFormatter(
|
||||
self::$container->get(TranslatorInterface::class),
|
||||
self::getContainer()->get(TranslatorInterface::class),
|
||||
$exportManager
|
||||
);
|
||||
|
||||
@@ -507,7 +507,7 @@ final class ExportManagerTest extends KernelTestCase
|
||||
array $aggregators = [],
|
||||
array $filters = [],
|
||||
): ExportManager {
|
||||
$localUser = $user ?? self::$container->get(
|
||||
$localUser = $user ?? self::getContainer()->get(
|
||||
UserRepositoryInterface::class
|
||||
)
|
||||
->findOneBy(['username' => 'center a_social']);
|
||||
@@ -516,9 +516,9 @@ final class ExportManagerTest extends KernelTestCase
|
||||
$tokenStorage->setToken($token);
|
||||
|
||||
return new ExportManager(
|
||||
$logger ?? self::$container->get('logger'),
|
||||
$authorizationChecker ?? self::$container->get('security.authorization_checker'),
|
||||
$authorizationHelper ?? self::$container->get('chill.main.security.authorization.helper'),
|
||||
$logger ?? self::getContainer()->get('logger'),
|
||||
$authorizationChecker ?? self::getContainer()->get('security.authorization_checker'),
|
||||
$authorizationHelper ?? self::getContainer()->get('chill.main.security.authorization.helper'),
|
||||
$tokenStorage,
|
||||
$exports,
|
||||
$aggregators,
|
||||
|
@@ -39,9 +39,9 @@ class SortExportElementTest extends KernelTestCase
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$sorter = self::$container->get(SortExportElement::class);
|
||||
$translator = self::$container->get(TranslatorInterface::class);
|
||||
$exportManager = self::$container->get(ExportManager::class);
|
||||
$sorter = self::getContainer()->get(SortExportElement::class);
|
||||
$translator = self::getContainer()->get(TranslatorInterface::class);
|
||||
$exportManager = self::getContainer()->get(ExportManager::class);
|
||||
$filters = $exportManager->getAllFilters();
|
||||
|
||||
$sorter->sortFilters($filters);
|
||||
|
Reference in New Issue
Block a user