mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 12: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:
@@ -28,7 +28,7 @@ class CollateAddressWithReferenceOrPostalCodeTest extends KernelTestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->connection = self::$container->get(Connection::class);
|
||||
$this->connection = self::getContainer()->get(Connection::class);
|
||||
}
|
||||
|
||||
public function testRun(): void
|
||||
|
@@ -66,7 +66,7 @@ final class RefreshAddressToGeographicalUnitMaterializedViewCronJobTest extends
|
||||
self::bootKernel();
|
||||
|
||||
$job = new \Chill\MainBundle\Service\AddressGeographicalUnit\RefreshAddressToGeographicalUnitMaterializedViewCronJob(
|
||||
self::$container->get(Connection::class),
|
||||
self::getContainer()->get(Connection::class),
|
||||
new MockClock()
|
||||
);
|
||||
|
||||
|
@@ -38,10 +38,10 @@ final class AddressReferenceBaseImporterTest extends KernelTestCase
|
||||
parent::setUp();
|
||||
self::bootKernel();
|
||||
|
||||
$this->importer = self::$container->get(AddressReferenceBaseImporter::class);
|
||||
$this->addressReferenceRepository = self::$container->get(AddressReferenceRepository::class);
|
||||
$this->entityManager = self::$container->get(EntityManagerInterface::class);
|
||||
$this->postalCodeRepository = self::$container->get(PostalCodeRepository::class);
|
||||
$this->importer = self::getContainer()->get(AddressReferenceBaseImporter::class);
|
||||
$this->addressReferenceRepository = self::getContainer()->get(AddressReferenceRepository::class);
|
||||
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
$this->postalCodeRepository = self::getContainer()->get(PostalCodeRepository::class);
|
||||
}
|
||||
|
||||
public function testImportAddress(): void
|
||||
|
@@ -42,11 +42,11 @@ class AddressToReferenceMatcherTest extends KernelTestCase
|
||||
parent::setUp();
|
||||
self::bootKernel();
|
||||
|
||||
$this->addressToReferenceMatcher = self::$container->get(AddressToReferenceMatcher::class);
|
||||
$this->addressReferenceRepository = self::$container->get(AddressReferenceRepository::class);
|
||||
$this->countryRepository = self::$container->get(CountryRepository::class);
|
||||
$this->addressReferenceBaseImporter = self::$container->get(AddressReferenceBaseImporter::class);
|
||||
$this->entityManager = self::$container->get(EntityManagerInterface::class);
|
||||
$this->addressToReferenceMatcher = self::getContainer()->get(AddressToReferenceMatcher::class);
|
||||
$this->addressReferenceRepository = self::getContainer()->get(AddressReferenceRepository::class);
|
||||
$this->countryRepository = self::getContainer()->get(CountryRepository::class);
|
||||
$this->addressReferenceBaseImporter = self::getContainer()->get(AddressReferenceBaseImporter::class);
|
||||
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
}
|
||||
|
||||
public function testCheckAddressesMatchingReferences(): void
|
||||
|
@@ -34,8 +34,8 @@ final class GeographicalUnitBaseImporterTest extends KernelTestCase
|
||||
|
||||
self::bootKernel();
|
||||
|
||||
$this->connection = self::$container->get(Connection::class);
|
||||
$this->entityManager = self::$container->get(EntityManagerInterface::class);
|
||||
$this->connection = self::getContainer()->get(Connection::class);
|
||||
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
}
|
||||
|
||||
public function testImportUnit(): void
|
||||
|
@@ -38,10 +38,10 @@ final class PostalCodeBaseImporterTest extends KernelTestCase
|
||||
|
||||
self::bootKernel();
|
||||
|
||||
$this->entityManager = self::$container->get(EntityManagerInterface::class);
|
||||
$this->importer = self::$container->get(PostalCodeBaseImporter::class);
|
||||
$this->postalCodeRepository = self::$container->get(PostalCodeRepository::class);
|
||||
$this->countryRepository = self::$container->get(CountryRepository::class);
|
||||
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
$this->importer = self::getContainer()->get(PostalCodeBaseImporter::class);
|
||||
$this->postalCodeRepository = self::getContainer()->get(PostalCodeRepository::class);
|
||||
$this->countryRepository = self::getContainer()->get(CountryRepository::class);
|
||||
}
|
||||
|
||||
public function testImportPostalCode(): void
|
||||
|
@@ -36,7 +36,7 @@ final class MenuComposerTest extends KernelTestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel(['environment' => 'test']);
|
||||
$this->menuComposer = self::$container
|
||||
$this->menuComposer = self::getContainer()
|
||||
->get('chill.main.menu_composer');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user