mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 18:43: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:
@@ -45,7 +45,7 @@ final class CalendarControllerTest extends WebTestCase
|
||||
public function provideAccompanyingPeriod(): iterable
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
$nb = $em->createQueryBuilder()
|
||||
->from(AccompanyingPeriod::class, 'ac')
|
||||
|
@@ -70,7 +70,7 @@ final class RemoteCalendarMSGraphSyncControllerTest extends WebTestCase
|
||||
$this->assertResponseStatusCodeSame(202);
|
||||
|
||||
/** @var InMemoryTransport $transport */
|
||||
$transport = self::$container->get('messenger.transport.async');
|
||||
$transport = self::getContainer()->get('messenger.transport.async');
|
||||
$this->assertCount(1, $transport->getSent());
|
||||
}
|
||||
|
||||
|
@@ -36,7 +36,7 @@ final class AgentAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->aggregator = self::$container->get('chill.calendar.export.agent_aggregator');
|
||||
$this->aggregator = self::getContainer()->get('chill.calendar.export.agent_aggregator');
|
||||
}
|
||||
|
||||
public function getAggregator()
|
||||
@@ -55,7 +55,7 @@ final class AgentAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
return [
|
||||
$em->createQueryBuilder()
|
||||
|
@@ -36,7 +36,7 @@ final class CancelReasonAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->aggregator = self::$container->get('chill.calendar.export.cancel_reason_aggregator');
|
||||
$this->aggregator = self::getContainer()->get('chill.calendar.export.cancel_reason_aggregator');
|
||||
}
|
||||
|
||||
public function getAggregator()
|
||||
@@ -55,7 +55,7 @@ final class CancelReasonAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
return [
|
||||
$em->createQueryBuilder()
|
||||
|
@@ -36,7 +36,7 @@ final class JobAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->aggregator = self::$container->get('chill.calendar.export.job_aggregator');
|
||||
$this->aggregator = self::getContainer()->get('chill.calendar.export.job_aggregator');
|
||||
}
|
||||
|
||||
public function getAggregator()
|
||||
@@ -55,7 +55,7 @@ final class JobAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
return [
|
||||
$em->createQueryBuilder()
|
||||
|
@@ -36,7 +36,7 @@ final class LocationAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->aggregator = self::$container->get('chill.calendar.export.location_aggregator');
|
||||
$this->aggregator = self::getContainer()->get('chill.calendar.export.location_aggregator');
|
||||
}
|
||||
|
||||
public function getAggregator()
|
||||
@@ -55,7 +55,7 @@ final class LocationAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
return [
|
||||
$em->createQueryBuilder()
|
||||
|
@@ -36,7 +36,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->aggregator = self::$container->get('chill.calendar.export.location_type_aggregator');
|
||||
$this->aggregator = self::getContainer()->get('chill.calendar.export.location_type_aggregator');
|
||||
}
|
||||
|
||||
public function getAggregator()
|
||||
@@ -55,7 +55,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
return [
|
||||
$em->createQueryBuilder()
|
||||
|
@@ -36,7 +36,7 @@ final class MonthYearAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->aggregator = self::$container->get('chill.calendar.export.month_aggregator');
|
||||
$this->aggregator = self::getContainer()->get('chill.calendar.export.month_aggregator');
|
||||
}
|
||||
|
||||
public function getAggregator()
|
||||
@@ -55,7 +55,7 @@ final class MonthYearAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
return [
|
||||
$em->createQueryBuilder()
|
||||
|
@@ -36,7 +36,7 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->aggregator = self::$container->get('chill.calendar.export.scope_aggregator');
|
||||
$this->aggregator = self::getContainer()->get('chill.calendar.export.scope_aggregator');
|
||||
}
|
||||
|
||||
public function getAggregator()
|
||||
@@ -55,7 +55,7 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
return [
|
||||
$em->createQueryBuilder()
|
||||
|
@@ -43,7 +43,7 @@ final class AgentFilterTest extends AbstractFilterTest
|
||||
$request->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||
$request->getLocale()->willReturn('fr');
|
||||
|
||||
$this->filter = self::$container->get('chill.calendar.export.agent_filter');
|
||||
$this->filter = self::getContainer()->get('chill.calendar.export.agent_filter');
|
||||
}
|
||||
|
||||
public function getFilter()
|
||||
@@ -54,7 +54,7 @@ final class AgentFilterTest extends AbstractFilterTest
|
||||
public function getFormData(): iterable
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
$array = $em->createQueryBuilder()
|
||||
->from(User::class, 'u')
|
||||
@@ -77,7 +77,7 @@ final class AgentFilterTest extends AbstractFilterTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
yield $em->createQueryBuilder()
|
||||
->select('cal.id')
|
||||
|
@@ -43,7 +43,7 @@ final class BetweenDatesFilterTest extends AbstractFilterTest
|
||||
$request->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||
$request->getLocale()->willReturn('fr');
|
||||
|
||||
$this->filter = self::$container->get('chill.calendar.export.between_dates_filter');
|
||||
$this->filter = self::getContainer()->get('chill.calendar.export.between_dates_filter');
|
||||
}
|
||||
|
||||
public function getFilter()
|
||||
@@ -65,7 +65,7 @@ final class BetweenDatesFilterTest extends AbstractFilterTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
return [
|
||||
$em->createQueryBuilder()
|
||||
|
@@ -44,7 +44,7 @@ final class JobFilterTest extends AbstractFilterTest
|
||||
$request->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||
$request->getLocale()->willReturn('fr');
|
||||
|
||||
$this->filter = self::$container->get('chill.calendar.export.job_filter');
|
||||
$this->filter = self::getContainer()->get('chill.calendar.export.job_filter');
|
||||
}
|
||||
|
||||
public function getFilter()
|
||||
@@ -55,7 +55,7 @@ final class JobFilterTest extends AbstractFilterTest
|
||||
public function getFormData(): iterable
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
$array = $em->createQueryBuilder()
|
||||
->from(UserJob::class, 'uj')
|
||||
@@ -75,7 +75,7 @@ final class JobFilterTest extends AbstractFilterTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
return [
|
||||
$em->createQueryBuilder()
|
||||
|
@@ -44,7 +44,7 @@ final class ScopeFilterTest extends AbstractFilterTest
|
||||
$request->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||
$request->getLocale()->willReturn('fr');
|
||||
|
||||
$this->filter = self::$container->get('chill.calendar.export.scope_filter');
|
||||
$this->filter = self::getContainer()->get('chill.calendar.export.scope_filter');
|
||||
}
|
||||
|
||||
public function getFilter()
|
||||
@@ -55,7 +55,7 @@ final class ScopeFilterTest 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')
|
||||
@@ -75,7 +75,7 @@ final class ScopeFilterTest extends AbstractFilterTest
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
return [
|
||||
$em->createQueryBuilder()
|
||||
|
@@ -36,7 +36,7 @@ final class CalendarACLAwareRepositoryTest extends KernelTestCase
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->entityManager = self::$container->get(EntityManagerInterface::class);
|
||||
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
}
|
||||
|
||||
public function testCountByPerosn()
|
||||
|
@@ -32,7 +32,7 @@ final class CalendarNormalizerTest extends KernelTestCase
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->normalizer = self::$container->get(NormalizerInterface::class);
|
||||
$this->normalizer = self::getContainer()->get(NormalizerInterface::class);
|
||||
}
|
||||
|
||||
public function testNormalizationCalendar()
|
||||
|
@@ -59,7 +59,7 @@ final class BulkCalendarShortMessageSenderTest extends KernelTestCase
|
||||
protected function tearDown(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
foreach ($this->toDelete as [$entity, $id]) {
|
||||
$entity = $em->find($entity, $id);
|
||||
@@ -71,7 +71,7 @@ final class BulkCalendarShortMessageSenderTest extends KernelTestCase
|
||||
|
||||
public function testSendBulkMessageToEligibleCalendar()
|
||||
{
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
$calendar = new Calendar();
|
||||
$calendar
|
||||
->addPerson($this->getRandomPerson($em))
|
||||
|
Reference in New Issue
Block a user