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:
2023-12-14 23:36:56 +01:00
parent 4a99480f50
commit 1098bafd3d
248 changed files with 631 additions and 628 deletions

View File

@@ -36,9 +36,9 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest
parent::setUp();
self::bootKernel();
$this->rollingDateConverter = self::$container->get(RollingDateConverterInterface::class);
$this->activityTypeRepository = self::$container->get(ActivityTypeRepositoryInterface::class);
$this->translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class);
$this->rollingDateConverter = self::getContainer()->get(RollingDateConverterInterface::class);
$this->activityTypeRepository = self::getContainer()->get(ActivityTypeRepositoryInterface::class);
$this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
}
public function getAggregator()
@@ -76,7 +76,7 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$this->aggregator = self::$container->get('chill.activity.export.bysocialaction_aggregator');
$this->aggregator = self::getContainer()->get('chill.activity.export.bysocialaction_aggregator');
}
public function getAggregator()
@@ -48,7 +48,7 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class BySocialIssueAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$this->aggregator = self::$container->get('chill.activity.export.bysocialissue_aggregator');
$this->aggregator = self::getContainer()->get('chill.activity.export.bysocialissue_aggregator');
}
public function getAggregator()
@@ -48,7 +48,7 @@ final class BySocialIssueAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -31,8 +31,8 @@ class ActivityPresenceAggregatorTest extends AbstractAggregatorTest
protected function setUp(): void
{
self::bootKernel();
$this->translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class);
$this->activityPresenceRepository = self::$container->get(ActivityPresenceRepositoryInterface::class);
$this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
$this->activityPresenceRepository = self::getContainer()->get(ActivityPresenceRepositoryInterface::class);
}
public function getAggregator()
@@ -51,7 +51,7 @@ class ActivityPresenceAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -34,14 +34,14 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$this->aggregator = self::$container->get(ActivityTypeAggregator::class);
$this->aggregator = self::getContainer()->get(ActivityTypeAggregator::class);
$request = $this->prophesize()
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
$request->getLocale()->willReturn('fr');
self::$container->get('request_stack')
self::getContainer()->get('request_stack')
->push($request->reveal());
}
@@ -61,7 +61,7 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -34,14 +34,14 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$this->aggregator = self::$container->get('chill.activity.export.user_aggregator');
$this->aggregator = self::getContainer()->get('chill.activity.export.user_aggregator');
$request = $this->prophesize()
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
$request->getLocale()->willReturn('fr');
self::$container->get('request_stack')
self::getContainer()->get('request_stack')
->push($request->reveal());
}
@@ -61,7 +61,7 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$this->aggregator = self::$container->get(ByThirdpartyAggregator::class);
$this->aggregator = self::getContainer()->get(ByThirdpartyAggregator::class);
}
public function getAggregator()
@@ -48,7 +48,7 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$this->aggregator = self::$container->get(ByCreatorAggregator::class);
$this->aggregator = self::getContainer()->get(ByCreatorAggregator::class);
}
public function getAggregator()
@@ -48,7 +48,7 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class CreatorJobAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$this->aggregator = self::$container->get(CreatorJobAggregator::class);
$this->aggregator = self::getContainer()->get(CreatorJobAggregator::class);
}
public function getAggregator()
@@ -48,7 +48,7 @@ final class CreatorJobAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class CreatorScopeAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$this->aggregator = self::$container->get(CreatorScopeAggregator::class);
$this->aggregator = self::getContainer()->get(CreatorScopeAggregator::class);
}
public function getAggregator()
@@ -48,7 +48,7 @@ final class CreatorScopeAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$this->aggregator = self::$container->get(DateAggregator::class);
$this->aggregator = self::getContainer()->get(DateAggregator::class);
}
public function getAggregator()
@@ -56,7 +56,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$this->aggregator = self::$container->get(LocationTypeAggregator::class);
$this->aggregator = self::getContainer()->get(LocationTypeAggregator::class);
}
public function getAggregator()
@@ -48,7 +48,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -32,14 +32,14 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$this->aggregator = self::$container->get(ActivityReasonAggregator::class);
$this->aggregator = self::getContainer()->get(ActivityReasonAggregator::class);
$request = $this->prophesize()
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
$request->getLocale()->willReturn('fr');
self::$container->get('request_stack')
self::getContainer()->get('request_stack')
->push($request->reveal());
}
@@ -60,7 +60,7 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ class PersonAggregatorTest extends AbstractAggregatorTest
protected function setUp(): void
{
self::bootKernel();
$this->labelPersonHelper = self::$container->get(LabelPersonHelper::class);
$this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class);
}
public function getAggregator()
@@ -46,7 +46,7 @@ class PersonAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -30,7 +30,7 @@ class PersonsAggregatorTest extends AbstractAggregatorTest
{
parent::setUp();
self::bootKernel();
$this->labelPersonHelper = self::$container->get(LabelPersonHelper::class);
$this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class);
}
public function getAggregator()
@@ -49,7 +49,7 @@ class PersonsAggregatorTest extends AbstractAggregatorTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class AvgActivityDurationTest extends AbstractExportTest
public function getExport()
{
$activityRepository = self::$container->get(ActivityRepository::class);
$activityRepository = self::getContainer()->get(ActivityRepository::class);
yield new AvgActivityDuration($activityRepository, $this->getParameters(true));
yield new AvgActivityDuration($activityRepository, $this->getParameters(false));

View File

@@ -29,7 +29,7 @@ final class AvgActivityVisitDurationTest extends AbstractExportTest
public function getExport()
{
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
yield new AvgActivityVisitDuration($em, $this->getParameters(true));
yield new AvgActivityVisitDuration($em, $this->getParameters(false));

View File

@@ -29,7 +29,7 @@ final class CountActivityTest extends AbstractExportTest
public function getExport()
{
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
yield new CountActivity($em, $this->getParameters(true));
yield new CountActivity($em, $this->getParameters(false));

View File

@@ -29,7 +29,7 @@ class CountHouseholdOnActivityTest extends AbstractExportTest
protected function setUp(): void
{
self::bootKernel();
$this->entityManager = self::$container->get(EntityManagerInterface::class);
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
}
public function getExport()

View File

@@ -31,7 +31,7 @@ class CountPersonsOnActivityTest extends AbstractExportTest
public function getExport()
{
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
yield new CountPersonsOnActivity($em, $this->getParameters(true));
yield new CountPersonsOnActivity($em, $this->getParameters(false));

View File

@@ -29,7 +29,7 @@ final class SumActivityDurationTest extends AbstractExportTest
public function getExport()
{
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
yield new SumActivityDuration($em, $this->getParameters(true));
yield new SumActivityDuration($em, $this->getParameters(false));

View File

@@ -28,12 +28,12 @@ final class SumActivityVisitDurationTest extends AbstractExportTest
{
self::bootKernel();
$this->export = self::$container->get('chill.activity.export.sum_activity_visit_duration_linked_to_acp');
$this->export = self::getContainer()->get('chill.activity.export.sum_activity_visit_duration_linked_to_acp');
}
public function getExport()
{
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
yield new SumActivityVisitDuration($em, $this->getParameters(true));
yield new SumActivityVisitDuration($em, $this->getParameters(false));

View File

@@ -29,7 +29,7 @@ final class CountActivityTest extends AbstractExportTest
public function getExport()
{
$activityRepository = self::$container->get(ActivityRepository::class);
$activityRepository = self::getContainer()->get(ActivityRepository::class);
yield new CountActivity($activityRepository, $this->getParameters(true));
yield new CountActivity($activityRepository, $this->getParameters(false));

View File

@@ -29,7 +29,7 @@ class CountHouseholdOnActivityTest extends AbstractExportTest
protected function setUp(): void
{
self::bootKernel();
$this->activityRepository = self::$container->get(ActivityRepository::class);
$this->activityRepository = self::getContainer()->get(ActivityRepository::class);
}
public function getExport()

View File

@@ -39,16 +39,16 @@ final class ListActivityTest extends AbstractExportTest
$request->getLocale()->willReturn('fr');
self::$container->get('request_stack')
self::getContainer()->get('request_stack')
->push($request->reveal());
}
public function getExport()
{
$em = self::$container->get(EntityManagerInterface::class);
$translator = self::$container->get(TranslatorInterface::class);
$translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class);
$activityRepository = self::$container->get(ActivityRepository::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$translator = self::getContainer()->get(TranslatorInterface::class);
$translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
$activityRepository = self::getContainer()->get(ActivityRepository::class);
yield new ListActivity(
$em,

View File

@@ -33,7 +33,7 @@ final class StatActivityDurationTest extends AbstractExportTest
public function getExport()
{
$activityRepository = self::$container->get(ActivityRepository::class);
$activityRepository = self::getContainer()->get(ActivityRepository::class);
yield new StatActivityDuration($activityRepository, $this->getParameters(true), 'sum');
yield new StatActivityDuration($activityRepository, $this->getParameters(false), 'sum');
}

View File

@@ -33,7 +33,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter::class);
$this->filter = self::getContainer()->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter::class);
}
public function getFilter()
@@ -44,7 +44,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
public function getFormData(): array
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(ActivityType::class, 'at')
@@ -90,7 +90,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -30,7 +30,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get(ByCreatorFilter::class);
$this->filter = self::getContainer()->get(ByCreatorFilter::class);
}
public function getFilter()
@@ -41,7 +41,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest
public function getFormData(): array
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(User::class, 'u')
@@ -65,7 +65,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -30,7 +30,7 @@ final class BySocialActionFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter::class);
$this->filter = self::getContainer()->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter::class);
}
public function getFilter()
@@ -42,7 +42,7 @@ final class BySocialActionFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(SocialAction::class, 'sa')
@@ -65,7 +65,7 @@ final class BySocialActionFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -31,7 +31,7 @@ final class BySocialIssueFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get(BySocialIssueFilter::class);
$this->filter = self::getContainer()->get(BySocialIssueFilter::class);
}
public function getFilter()
@@ -42,7 +42,7 @@ final class BySocialIssueFilterTest extends AbstractFilterTest
public function getFormData(): array
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(SocialIssue::class, 'si')
@@ -68,7 +68,7 @@ final class BySocialIssueFilterTest extends AbstractFilterTest
self::bootKernel();
}
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -30,7 +30,7 @@ final class ActivityDateFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get(ActivityDateFilter::class);
$this->filter = self::getContainer()->get(ActivityDateFilter::class);
}
public function getFilter()
@@ -52,7 +52,7 @@ final class ActivityDateFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
yield $em->createQueryBuilder()
->select('count(activity.id)')

View File

@@ -35,8 +35,8 @@ class ActivityPresenceFilterTest extends AbstractFilterTest
parent::setUp();
self::bootKernel();
$this->translator = self::$container->get(TranslatorInterface::class);
$this->translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class);
$this->translator = self::getContainer()->get(TranslatorInterface::class);
$this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
}
public function getFilter()
@@ -48,7 +48,7 @@ class ActivityPresenceFilterTest extends AbstractFilterTest
{
self::bootKernel();
$presences = self::$container->get(ActivityPresenceRepositoryInterface::class)
$presences = self::getContainer()->get(ActivityPresenceRepositoryInterface::class)
->findAll();
return [
@@ -65,7 +65,7 @@ class ActivityPresenceFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
yield $em->createQueryBuilder()
->select('count(activity.id)')

View File

@@ -33,14 +33,14 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get('chill.activity.export.reason_filter');
$this->filter = self::getContainer()->get('chill.activity.export.reason_filter');
$request = $this->prophesize()
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
$request->getLocale()->willReturn('fr');
self::$container->get(RequestStack::class)
self::getContainer()->get(RequestStack::class)
->push($request->reveal());
}
@@ -54,7 +54,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
self::bootKernel();
$data = [];
$em = self::$container
$em = self::getContainer()
->get(EntityManagerInterface::class);
$reasons = $em->createQuery('SELECT reason '
@@ -76,7 +76,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
yield $em->createQueryBuilder()
->select('count(activity.id)')

View File

@@ -31,7 +31,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get('chill.activity.export.type_filter');
$this->filter = self::getContainer()->get('chill.activity.export.type_filter');
}
public function getFilter()
@@ -43,7 +43,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(ActivityType::class, 'at')
@@ -69,7 +69,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
yield $em->createQueryBuilder()
->select('count(activity.id)')

View File

@@ -30,7 +30,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get(ByCreatorFilter::class);
$this->filter = self::getContainer()->get(ByCreatorFilter::class);
}
public function getFilter()
@@ -40,7 +40,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest
public function getFormData(): array
{
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(User::class, 'u')
@@ -65,7 +65,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest
self::bootKernel();
}
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -36,10 +36,10 @@ class CreatorJobFilterTest extends AbstractFilterTest
parent::setUp();
self::bootKernel();
$this->entityManager = self::$container->get(EntityManagerInterface::class);
$this->translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class);
$this->translator = self::$container->get(TranslatorInterface::class);
$this->userJobRepository = self::$container->get(UserJobRepositoryInterface::class);
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
$this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
$this->translator = self::getContainer()->get(TranslatorInterface::class);
$this->userJobRepository = self::getContainer()->get(UserJobRepositoryInterface::class);
}
public function getFilter()

View File

@@ -30,7 +30,7 @@ final class CreatorScopeFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get(CreatorScopeFilter::class);
$this->filter = self::getContainer()->get(CreatorScopeFilter::class);
}
public function getFilter()
@@ -41,7 +41,7 @@ final class CreatorScopeFilterTest extends AbstractFilterTest
public function getFormData(): array
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(Scope::class, 's')
@@ -65,7 +65,7 @@ final class CreatorScopeFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class EmergencyFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get(EmergencyFilter::class);
$this->filter = self::getContainer()->get(EmergencyFilter::class);
}
public function getFilter()
@@ -49,7 +49,7 @@ final class EmergencyFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -30,7 +30,7 @@ final class LocationTypeFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get(LocationTypeFilter::class);
$this->filter = self::getContainer()->get(LocationTypeFilter::class);
}
public function getFilter()
@@ -41,7 +41,7 @@ final class LocationTypeFilterTest extends AbstractFilterTest
public function getFormData(): array
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(LocationType::class, 'lt')
@@ -65,7 +65,7 @@ final class LocationTypeFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -31,7 +31,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get('chill.activity.export.reason_filter');
$this->filter = self::getContainer()->get('chill.activity.export.reason_filter');
}
public function getFilter()
@@ -42,7 +42,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
public function getFormData(): array
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(ActivityReason::class, 'ar')
@@ -66,7 +66,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -30,7 +30,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get('chill.activity.export.person_having_an_activity_between_date_filter');
$this->filter = self::getContainer()->get('chill.activity.export.person_having_an_activity_between_date_filter');
}
public function getFilter()
@@ -41,7 +41,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
public function getFormData(): array
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(ActivityReason::class, 'ar')
@@ -69,7 +69,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
self::bootKernel();
}
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -32,14 +32,14 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get('chill.activity.export.person_having_an_activity_between_date_filter');
$this->filter = self::getContainer()->get('chill.activity.export.person_having_an_activity_between_date_filter');
$request = $this->prophesize()
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
$request->getLocale()->willReturn('fr');
self::$container->get(RequestStack::class)
self::getContainer()->get(RequestStack::class)
->push($request->reveal());
}
@@ -71,7 +71,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container
$em = self::getContainer()
->get(EntityManagerInterface::class);
yield $em->createQueryBuilder()
@@ -98,7 +98,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
{
self::bootKernel();
$managerRegistry = self::$container->get(ManagerRegistry::class);
$managerRegistry = self::getContainer()->get(ManagerRegistry::class);
$requestStack = new RequestStack();
$requestStack->push(new Request());

View File

@@ -31,7 +31,7 @@ class PersonsFilterTest extends AbstractFilterTest
{
parent::setUp();
self::bootKernel();
$this->personRender = self::$container->get(PersonRenderInterface::class);
$this->personRender = self::getContainer()->get(PersonRenderInterface::class);
}
public function getFilter()
@@ -42,7 +42,7 @@ class PersonsFilterTest extends AbstractFilterTest
public function getFormData()
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$persons = $em->createQuery('SELECT p FROM '.Person::class.' p ')
->setMaxResults(2)
@@ -61,7 +61,7 @@ class PersonsFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
yield $em->createQueryBuilder()
->select('count(activity.id)')

View File

@@ -29,7 +29,7 @@ final class SentReceivedFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get(SentReceivedFilter::class);
$this->filter = self::getContainer()->get(SentReceivedFilter::class);
}
public function getFilter()
@@ -49,7 +49,7 @@ final class SentReceivedFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -30,7 +30,7 @@ final class UserFilterTest extends AbstractFilterTest
{
self::bootKernel();
$this->filter = self::$container->get(UserFilter::class);
$this->filter = self::getContainer()->get(UserFilter::class);
}
public function getFilter()
@@ -41,7 +41,7 @@ final class UserFilterTest extends AbstractFilterTest
public function getFormData(): array
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(User::class, 'u')
@@ -65,7 +65,7 @@ final class UserFilterTest extends AbstractFilterTest
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
$em = self::getContainer()->get(EntityManagerInterface::class);
return [
$em->createQueryBuilder()

View File

@@ -32,7 +32,7 @@ final class TranslatableActivityTypeTest extends KernelTestCase
{
self::bootKernel();
$this->builder = self::$container
$this->builder = self::getContainer()
->get('form.factory')
->createBuilder(FormType::class, null, [
'csrf_protection' => false,

View File

@@ -55,11 +55,11 @@ class ActivityACLAwareRepositoryTest extends KernelTestCase
{
self::bootKernel();
$this->authorizationHelperForCurrentUser = self::$container->get(AuthorizationHelperForCurrentUserInterface::class);
$this->centerResolverManager = self::$container->get(CenterResolverManagerInterface::class);
$this->activityRepository = self::$container->get(ActivityRepository::class);
$this->entityManager = self::$container->get(EntityManagerInterface::class);
$this->security = self::$container->get(Security::class);
$this->authorizationHelperForCurrentUser = self::getContainer()->get(AuthorizationHelperForCurrentUserInterface::class);
$this->centerResolverManager = self::getContainer()->get(CenterResolverManagerInterface::class);
$this->activityRepository = self::getContainer()->get(ActivityRepository::class);
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
$this->security = self::getContainer()->get(Security::class);
$this->requestStack = $requestStack = new RequestStack();
$request = $this->prophesize(Request::class);

View File

@@ -45,10 +45,10 @@ class ActivityDocumentACLAwareRepositoryTest extends KernelTestCase
protected function setUp(): void
{
self::bootKernel();
$this->entityManager = self::$container->get(EntityManagerInterface::class);
$this->centerResolverManager = self::$container->get(CenterResolverManagerInterface::class);
$this->authorizationHelperForCurrentUser = self::$container->get(AuthorizationHelperForCurrentUserInterface::class);
$this->security = self::$container->get(Security::class);
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
$this->centerResolverManager = self::getContainer()->get(CenterResolverManagerInterface::class);
$this->authorizationHelperForCurrentUser = self::getContainer()->get(AuthorizationHelperForCurrentUserInterface::class);
$this->security = self::getContainer()->get(Security::class);
}
/**