diff --git a/src/DataTables/Filters/Constraints/NumberConstraint.php b/src/DataTables/Filters/Constraints/NumberConstraint.php index 3d02004e..e8382723 100644 --- a/src/DataTables/Filters/Constraints/NumberConstraint.php +++ b/src/DataTables/Filters/Constraints/NumberConstraint.php @@ -22,7 +22,7 @@ namespace App\DataTables\Filters\Constraints; use Doctrine\DBAL\ParameterType; use Doctrine\ORM\QueryBuilder; -use \RuntimeException; +use RuntimeException; class NumberConstraint extends AbstractConstraint { diff --git a/src/DataTables/PartsDataTable.php b/src/DataTables/PartsDataTable.php index 4f61fcf6..e77cd081 100644 --- a/src/DataTables/PartsDataTable.php +++ b/src/DataTables/PartsDataTable.php @@ -378,7 +378,7 @@ final class PartsDataTable implements DataTableTypeInterface ->addGroupBy('suppliers') ->addGroupBy('attachments') ->addGroupBy('partUnit') - ->addGroupBy('parameters'); + ->addGroupBy('parameters') ; } diff --git a/src/Entity/Attachments/Attachment.php b/src/Entity/Attachments/Attachment.php index 753f59cf..0f603c09 100644 --- a/src/Entity/Attachments/Attachment.php +++ b/src/Entity/Attachments/Attachment.php @@ -185,7 +185,7 @@ abstract class Attachment extends AbstractNamedDBElement //After the %PLACEHOLDER% comes a slash, so we can check if we have a placeholder via explode $tmp = explode('/', $this->path); - return !in_array($tmp[0], array_merge(static::INTERNAL_PLACEHOLDER, static::BUILTIN_PLACEHOLDER)); + return !in_array($tmp[0], array_merge(static::INTERNAL_PLACEHOLDER, static::BUILTIN_PLACEHOLDER), true); } /** @@ -331,7 +331,7 @@ abstract class Attachment extends AbstractNamedDBElement */ public function getShowInTable(): bool { - return (bool) $this->show_in_table; + return $this->show_in_table; } /** diff --git a/src/Entity/Parts/PartLot.php b/src/Entity/Parts/PartLot.php index 386905dc..1201f254 100644 --- a/src/Entity/Parts/PartLot.php +++ b/src/Entity/Parts/PartLot.php @@ -259,7 +259,7 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named return round($this->amount); } - return (float) $this->amount; + return $this->amount; } /** diff --git a/src/Entity/Parts/Storelocation.php b/src/Entity/Parts/Storelocation.php index 5da878a1..53e71060 100644 --- a/src/Entity/Parts/Storelocation.php +++ b/src/Entity/Parts/Storelocation.php @@ -107,7 +107,7 @@ class Storelocation extends AbstractPartsContainingDBElement */ public function isFull(): bool { - return (bool) $this->is_full; + return $this->is_full; } /** diff --git a/src/Entity/PriceInformations/Orderdetail.php b/src/Entity/PriceInformations/Orderdetail.php index a6a14600..96ef6443 100644 --- a/src/Entity/PriceInformations/Orderdetail.php +++ b/src/Entity/PriceInformations/Orderdetail.php @@ -176,7 +176,7 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface, N */ public function getObsolete(): bool { - return (bool) $this->obsolete; + return $this->obsolete; } /** diff --git a/src/Entity/PriceInformations/Pricedetail.php b/src/Entity/PriceInformations/Pricedetail.php index 623603b8..8c119ee8 100644 --- a/src/Entity/PriceInformations/Pricedetail.php +++ b/src/Entity/PriceInformations/Pricedetail.php @@ -187,7 +187,7 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface if ($this->orderdetail && $this->orderdetail->getPart() && !$this->orderdetail->getPart()->useFloatAmount()) { $tmp = round($this->price_related_quantity); - return $tmp < 1 ? 1 : $tmp; + return max($tmp, 1); } return $this->price_related_quantity; diff --git a/src/Entity/UserSystem/User.php b/src/Entity/UserSystem/User.php index 349b5293..863e0f26 100644 --- a/src/Entity/UserSystem/User.php +++ b/src/Entity/UserSystem/User.php @@ -283,7 +283,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe */ public function getUsername(): string { - return (string) $this->name; + return $this->name; } public function getUserIdentifier(): string diff --git a/src/Form/Part/PartBaseType.php b/src/Form/Part/PartBaseType.php index 3f7a4d82..d9365369 100644 --- a/src/Form/Part/PartBaseType.php +++ b/src/Form/Part/PartBaseType.php @@ -50,8 +50,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Security\Core\Security; -use function Sodium\add; - class PartBaseType extends AbstractType { protected Security $security; diff --git a/src/Repository/LogEntryRepository.php b/src/Repository/LogEntryRepository.php index 65c4b600..d8bfe24a 100644 --- a/src/Repository/LogEntryRepository.php +++ b/src/Repository/LogEntryRepository.php @@ -30,9 +30,6 @@ use App\Entity\LogSystem\ElementDeletedLogEntry; use App\Entity\LogSystem\ElementEditedLogEntry; use App\Entity\UserSystem\User; use DateTime; -use Doctrine\ORM\OptimisticLockException; -use Doctrine\ORM\ORMException; -use Doctrine\ORM\TransactionRequiredException; use RuntimeException; class LogEntryRepository extends DBElementRepository diff --git a/src/Services/EntityURLGenerator.php b/src/Services/EntityURLGenerator.php index d5cf832d..2d0afd88 100644 --- a/src/Services/EntityURLGenerator.php +++ b/src/Services/EntityURLGenerator.php @@ -166,16 +166,11 @@ class EntityURLGenerator public function viewURL(Attachment $entity): ?string { - if ($entity instanceof Attachment) { - if ($entity->isExternal()) { //For external attachments, return the link to external path - return $entity->getURL(); - } - //return $this->urlGenerator->generate('attachment_view', ['id' => $entity->getID()]); - return $this->attachmentURLGenerator->getViewURL($entity); + if ($entity->isExternal()) { //For external attachments, return the link to external path + return $entity->getURL(); } - - //Otherwise throw an error - throw new EntityNotSupportedException('The given entity is not supported yet!'); + //return $this->urlGenerator->generate('attachment_view', ['id' => $entity->getID()]); + return $this->attachmentURLGenerator->getViewURL($entity); } public function downloadURL($entity): ?string diff --git a/src/Services/Tools/TagFinder.php b/src/Services/Tools/TagFinder.php index 87150528..aa0d02bd 100644 --- a/src/Services/Tools/TagFinder.php +++ b/src/Services/Tools/TagFinder.php @@ -26,7 +26,7 @@ use App\Entity\Parts\Part; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\OptionsResolver\OptionsResolver; -use function \mb_strlen; +use function mb_strlen; use function array_slice; /** diff --git a/src/Services/UserSystem/UserCacheKeyGenerator.php b/src/Services/UserSystem/UserCacheKeyGenerator.php index ae615229..dff4e793 100644 --- a/src/Services/UserSystem/UserCacheKeyGenerator.php +++ b/src/Services/UserSystem/UserCacheKeyGenerator.php @@ -55,7 +55,7 @@ class UserCacheKeyGenerator //If the user is null, then treat it as anonymous user. //When the anonymous user is passed as user then use this path too. - if (null === $user || !($user instanceof User) || User::ID_ANONYMOUS === $user->getID()) { + if (!($user instanceof User) || User::ID_ANONYMOUS === $user->getID()) { return 'user$_'.User::ID_ANONYMOUS; } diff --git a/tests/Controller/RedirectControllerTest.php b/tests/Controller/RedirectControllerTest.php index a8e98a39..69b197e3 100644 --- a/tests/Controller/RedirectControllerTest.php +++ b/tests/Controller/RedirectControllerTest.php @@ -22,8 +22,8 @@ declare(strict_types=1); namespace App\Tests\Controller; +use App\Entity\UserSystem\User; use Doctrine\ORM\EntityManagerInterface; -use Proxies\__CG__\App\Entity\UserSystem\User; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; /** @@ -44,7 +44,7 @@ class RedirectControllerTest extends WebTestCase ]); $this->client->disableReboot(); $this->client->catchExceptions(false); - $this->em = self::$container->get(EntityManagerInterface::class); + $this->em = self::getContainer()->get(EntityManagerInterface::class); $this->userRepo = $this->em->getRepository(User::class); } diff --git a/tests/Helpers/TreeViewNodeTest.php b/tests/Helpers/TreeViewNodeTest.php index 2a387ed8..d7ee81f9 100644 --- a/tests/Helpers/TreeViewNodeTest.php +++ b/tests/Helpers/TreeViewNodeTest.php @@ -40,7 +40,7 @@ class TreeViewNodeTest extends TestCase { $sub_nodes = []; $sub_nodes[] = new TreeViewNode('Subnode 1'); - $sub_sub_nodes[] = []; + $sub_sub_nodes = []; $sub_sub_nodes[] = new TreeViewNode('Sub Subnode 1'); $sub_sub_nodes[] = new TreeViewNode('Sub Subnode 2'); $sub_nodes[] = new TreeViewNode('Subnode 2'); diff --git a/tests/Services/Attachments/AttachmentURLGeneratorTest.php b/tests/Services/Attachments/AttachmentURLGeneratorTest.php index 9e4107ac..1588a951 100644 --- a/tests/Services/Attachments/AttachmentURLGeneratorTest.php +++ b/tests/Services/Attachments/AttachmentURLGeneratorTest.php @@ -35,7 +35,7 @@ class AttachmentURLGeneratorTest extends WebTestCase { //Get an service instance. self::bootKernel(); - self::$service = self::$container->get(AttachmentURLGenerator::class); + self::$service = self::getContainer()->get(AttachmentURLGenerator::class); } public function dataProvider(): array diff --git a/tests/Services/Attachments/BuiltinAttachmentsFinderTest.php b/tests/Services/Attachments/BuiltinAttachmentsFinderTest.php index 2579ffd9..499ab8f4 100644 --- a/tests/Services/Attachments/BuiltinAttachmentsFinderTest.php +++ b/tests/Services/Attachments/BuiltinAttachmentsFinderTest.php @@ -40,7 +40,7 @@ class BuiltinAttachmentsFinderTest extends WebTestCase { //Get an service instance. self::bootKernel(); - self::$service = self::$container->get(BuiltinAttachmentsFinder::class); + self::$service = self::getContainer()->get(BuiltinAttachmentsFinder::class); } public function dataProvider(): array diff --git a/tests/Services/Attachments/FileTypeFilterToolsTest.php b/tests/Services/Attachments/FileTypeFilterToolsTest.php index 8f70bfc3..63aa8bde 100644 --- a/tests/Services/Attachments/FileTypeFilterToolsTest.php +++ b/tests/Services/Attachments/FileTypeFilterToolsTest.php @@ -32,7 +32,7 @@ class FileTypeFilterToolsTest extends WebTestCase public static function setUpBeforeClass(): void { self::bootKernel(); - self::$service = self::$container->get(FileTypeFilterTools::class); + self::$service = self::getContainer()->get(FileTypeFilterTools::class); } public function validateDataProvider(): array diff --git a/tests/Services/Formatters/AmountFormatterTest.php b/tests/Services/Formatters/AmountFormatterTest.php index 626ac2ea..40df0af7 100644 --- a/tests/Services/Formatters/AmountFormatterTest.php +++ b/tests/Services/Formatters/AmountFormatterTest.php @@ -40,7 +40,7 @@ class AmountFormatterTest extends WebTestCase //Get an service instance. self::bootKernel(); - $this->service = self::$container->get(AmountFormatter::class); + $this->service = self::getContainer()->get(AmountFormatter::class); } public function testFormatWithoutUnit(): void diff --git a/tests/Services/ImportExportSystem/EntityImporterTest.php b/tests/Services/ImportExportSystem/EntityImporterTest.php index 4373a0d0..acc7077b 100644 --- a/tests/Services/ImportExportSystem/EntityImporterTest.php +++ b/tests/Services/ImportExportSystem/EntityImporterTest.php @@ -43,7 +43,7 @@ class EntityImporterTest extends WebTestCase //Get an service instance. self::bootKernel(); - $this->service = self::$container->get(EntityImporter::class); + $this->service = self::getContainer()->get(EntityImporter::class); } public function testMassCreationResults(): void diff --git a/tests/Services/LabelSystem/Barcodes/BarcodeContentGeneratorTest.php b/tests/Services/LabelSystem/Barcodes/BarcodeContentGeneratorTest.php index 6c3c7d38..fe98ccdf 100644 --- a/tests/Services/LabelSystem/Barcodes/BarcodeContentGeneratorTest.php +++ b/tests/Services/LabelSystem/Barcodes/BarcodeContentGeneratorTest.php @@ -57,7 +57,7 @@ class BarcodeContentGeneratorTest extends KernelTestCase protected function setUp(): void { self::bootKernel(); - $this->service = self::$container->get(BarcodeContentGenerator::class); + $this->service = self::getContainer()->get(BarcodeContentGenerator::class); } public function Barcode1DDataProvider(): array diff --git a/tests/Services/LabelSystem/Barcodes/BarcodeNormalizerTest.php b/tests/Services/LabelSystem/Barcodes/BarcodeNormalizerTest.php index ff0c0d97..b8d34cc0 100644 --- a/tests/Services/LabelSystem/Barcodes/BarcodeNormalizerTest.php +++ b/tests/Services/LabelSystem/Barcodes/BarcodeNormalizerTest.php @@ -54,7 +54,7 @@ class BarcodeNormalizerTest extends WebTestCase protected function setUp(): void { self::bootKernel(); - $this->service = self::$container->get(BarcodeNormalizer::class); + $this->service = self::getContainer()->get(BarcodeNormalizer::class); } public function dataProvider(): array diff --git a/tests/Services/LabelSystem/Barcodes/BarcodeRedirectorTest.php b/tests/Services/LabelSystem/Barcodes/BarcodeRedirectorTest.php index 83ebd5d6..5e7a7ad8 100644 --- a/tests/Services/LabelSystem/Barcodes/BarcodeRedirectorTest.php +++ b/tests/Services/LabelSystem/Barcodes/BarcodeRedirectorTest.php @@ -55,7 +55,7 @@ class BarcodeRedirectorTest extends KernelTestCase protected function setUp(): void { self::bootKernel(); - $this->service = self::$container->get(BarcodeRedirector::class); + $this->service = self::getContainer()->get(BarcodeRedirector::class); } public function urlDataProvider(): array diff --git a/tests/Services/LabelSystem/LabelGeneratorTest.php b/tests/Services/LabelSystem/LabelGeneratorTest.php index 427f60da..68254f3e 100644 --- a/tests/Services/LabelSystem/LabelGeneratorTest.php +++ b/tests/Services/LabelSystem/LabelGeneratorTest.php @@ -59,7 +59,7 @@ class LabelGeneratorTest extends WebTestCase protected function setUp(): void { self::bootKernel(); - $this->service = self::$container->get(LabelGenerator::class); + $this->service = self::getContainer()->get(LabelGenerator::class); } public function supportsDataProvider(): array diff --git a/tests/Services/LabelSystem/LabelTextReplacerTest.php b/tests/Services/LabelSystem/LabelTextReplacerTest.php index 92d55d09..09635562 100644 --- a/tests/Services/LabelSystem/LabelTextReplacerTest.php +++ b/tests/Services/LabelSystem/LabelTextReplacerTest.php @@ -64,7 +64,7 @@ class LabelTextReplacerTest extends WebTestCase //Get an service instance. self::bootKernel(); - $this->service = self::$container->get(LabelTextReplacer::class); + $this->service = self::getContainer()->get(LabelTextReplacer::class); $this->target = new Part(); $this->target->setName('Part 1'); diff --git a/tests/Services/LabelSystem/PlaceholderProviders/AbstractElementProviderTest.php b/tests/Services/LabelSystem/PlaceholderProviders/AbstractElementProviderTest.php index b61b721f..ee32ca94 100644 --- a/tests/Services/LabelSystem/PlaceholderProviders/AbstractElementProviderTest.php +++ b/tests/Services/LabelSystem/PlaceholderProviders/AbstractElementProviderTest.php @@ -57,7 +57,7 @@ class AbstractElementProviderTest extends WebTestCase protected function setUp(): void { self::bootKernel(); - $this->service = self::$container->get(AbstractDBElementProvider::class); + $this->service = self::getContainer()->get(AbstractDBElementProvider::class); $this->target = new class() extends AbstractDBElement { protected ?int $id = 123; }; diff --git a/tests/Services/LabelSystem/PlaceholderProviders/GlobalProvidersTest.php b/tests/Services/LabelSystem/PlaceholderProviders/GlobalProvidersTest.php index c66f3230..3a66aa87 100644 --- a/tests/Services/LabelSystem/PlaceholderProviders/GlobalProvidersTest.php +++ b/tests/Services/LabelSystem/PlaceholderProviders/GlobalProvidersTest.php @@ -57,7 +57,7 @@ class GlobalProvidersTest extends WebTestCase protected function setUp(): void { self::bootKernel(); - $this->service = self::$container->get(GlobalProviders::class); + $this->service = self::getContainer()->get(GlobalProviders::class); $this->target = new Part(); } diff --git a/tests/Services/LabelSystem/PlaceholderProviders/NamedElementProviderTest.php b/tests/Services/LabelSystem/PlaceholderProviders/NamedElementProviderTest.php index 17745f29..e5644515 100644 --- a/tests/Services/LabelSystem/PlaceholderProviders/NamedElementProviderTest.php +++ b/tests/Services/LabelSystem/PlaceholderProviders/NamedElementProviderTest.php @@ -57,7 +57,7 @@ class NamedElementProviderTest extends WebTestCase protected function setUp(): void { self::bootKernel(); - $this->service = self::$container->get(NamedElementProvider::class); + $this->service = self::getContainer()->get(NamedElementProvider::class); $this->target = new class() implements NamedElementInterface { public function getName(): string { diff --git a/tests/Services/LabelSystem/PlaceholderProviders/PartProviderTest.php b/tests/Services/LabelSystem/PlaceholderProviders/PartProviderTest.php index 55da8f8a..a97cb438 100644 --- a/tests/Services/LabelSystem/PlaceholderProviders/PartProviderTest.php +++ b/tests/Services/LabelSystem/PlaceholderProviders/PartProviderTest.php @@ -68,9 +68,9 @@ class PartProviderTest extends WebTestCase protected function setUp(): void { self::bootKernel(); - $this->service = self::$container->get(PartProvider::class); + $this->service = self::getContainer()->get(PartProvider::class); $this->target = new Part(); - $this->em = self::$container->get(EntityManagerInterface::class); + $this->em = self::getContainer()->get(EntityManagerInterface::class); $this->target->setCategory($this->em->find(Category::class, 6)); $this->target->setFootprint($this->em->find(Footprint::class, 6)); diff --git a/tests/Services/LabelSystem/PlaceholderProviders/TimestampableElementProviderTest.php b/tests/Services/LabelSystem/PlaceholderProviders/TimestampableElementProviderTest.php index 518c0e8c..79b9a95f 100644 --- a/tests/Services/LabelSystem/PlaceholderProviders/TimestampableElementProviderTest.php +++ b/tests/Services/LabelSystem/PlaceholderProviders/TimestampableElementProviderTest.php @@ -60,7 +60,7 @@ class TimestampableElementProviderTest extends WebTestCase { self::bootKernel(); \Locale::setDefault('en'); - $this->service = self::$container->get(TimestampableElementProvider::class); + $this->service = self::getContainer()->get(TimestampableElementProvider::class); $this->target = new class() implements TimeStampableInterface { public function getLastModified(): ?DateTime { diff --git a/tests/Services/LogSystem/EventCommentHelperTest.php b/tests/Services/LogSystem/EventCommentHelperTest.php index e531165e..4cab7bb4 100644 --- a/tests/Services/LogSystem/EventCommentHelperTest.php +++ b/tests/Services/LogSystem/EventCommentHelperTest.php @@ -57,7 +57,7 @@ class EventCommentHelperTest extends WebTestCase //Get an service instance. self::bootKernel(); - $this->service = self::$container->get(EventCommentHelper::class); + $this->service = self::getContainer()->get(EventCommentHelper::class); } public function testInitialState(): void diff --git a/tests/Services/LogSystem/EventLoggerTest.php b/tests/Services/LogSystem/EventLoggerTest.php index f7ea7c45..77be97db 100644 --- a/tests/Services/LogSystem/EventLoggerTest.php +++ b/tests/Services/LogSystem/EventLoggerTest.php @@ -60,7 +60,7 @@ class EventLoggerTest extends WebTestCase //Get an service instance. self::bootKernel(); - $this->service = self::$container->get(EventLogger::class); + $this->service = self::getContainer()->get(EventLogger::class); } public function testShouldBeAdded(): void diff --git a/tests/Services/Misc/FAIconGeneratorTest.php b/tests/Services/Misc/FAIconGeneratorTest.php index 8255ea05..91255f68 100644 --- a/tests/Services/Misc/FAIconGeneratorTest.php +++ b/tests/Services/Misc/FAIconGeneratorTest.php @@ -29,7 +29,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class FAIconGeneratorTest extends WebTestCase { /** - * @var AmountFormatter + * @var FAIconGenerator */ protected $service; @@ -39,7 +39,7 @@ class FAIconGeneratorTest extends WebTestCase //Get an service instance. self::bootKernel(); - $this->service = self::$container->get(FAIconGenerator::class); + $this->service = self::getContainer()->get(FAIconGenerator::class); } public function fileExtensionDataProvider(): array diff --git a/tests/Services/Misc/RangeParserTest.php b/tests/Services/Misc/RangeParserTest.php index 368caf8a..2ffa5f04 100644 --- a/tests/Services/Misc/RangeParserTest.php +++ b/tests/Services/Misc/RangeParserTest.php @@ -54,7 +54,7 @@ class RangeParserTest extends WebTestCase protected function setUp(): void { self::bootKernel(); - $this->service = self::$container->get(RangeParser::class); + $this->service = self::getContainer()->get(RangeParser::class); } public function dataProvider(): array diff --git a/tests/Services/Parameters/ParameterExtractorTest.php b/tests/Services/Parameters/ParameterExtractorTest.php index e81c4b4c..ceb28456 100644 --- a/tests/Services/Parameters/ParameterExtractorTest.php +++ b/tests/Services/Parameters/ParameterExtractorTest.php @@ -54,7 +54,7 @@ class ParameterExtractorTest extends WebTestCase parent::setUp(); //Get an service instance. self::bootKernel(); - $this->service = self::$container->get(ParameterExtractor::class); + $this->service = self::getContainer()->get(ParameterExtractor::class); } public function emptyDataProvider(): array diff --git a/tests/Services/Parts/PricedetailHelperTest.php b/tests/Services/Parts/PricedetailHelperTest.php index a1d57088..aff0fdba 100644 --- a/tests/Services/Parts/PricedetailHelperTest.php +++ b/tests/Services/Parts/PricedetailHelperTest.php @@ -41,7 +41,7 @@ class PricedetailHelperTest extends WebTestCase parent::setUp(); //Get an service instance. self::bootKernel(); - $this->service = self::$container->get(PricedetailHelper::class); + $this->service = self::getContainer()->get(PricedetailHelper::class); } public function maxDiscountAmountDataProvider(): ?\Generator diff --git a/tests/Services/Trees/NodesListBuilderTest.php b/tests/Services/Trees/NodesListBuilderTest.php index 1ed2346d..8f4bf23b 100644 --- a/tests/Services/Trees/NodesListBuilderTest.php +++ b/tests/Services/Trees/NodesListBuilderTest.php @@ -41,8 +41,8 @@ class NodesListBuilderTest extends WebTestCase protected function setUp(): void { self::bootKernel(); - $this->service = self::$container->get(NodesListBuilder::class); - $this->em = self::$container->get(EntityManagerInterface::class); + $this->service = self::getContainer()->get(NodesListBuilder::class); + $this->em = self::getContainer()->get(EntityManagerInterface::class); } /** diff --git a/tests/Services/Trees/TreeViewGeneratorTest.php b/tests/Services/Trees/TreeViewGeneratorTest.php index 05a5b71b..feedbfcb 100644 --- a/tests/Services/Trees/TreeViewGeneratorTest.php +++ b/tests/Services/Trees/TreeViewGeneratorTest.php @@ -46,8 +46,8 @@ class TreeViewGeneratorTest extends WebTestCase //Get an service instance. self::bootKernel(); - $this->service = self::$container->get(TreeViewGenerator::class); - $this->em = self::$container->get(EntityManagerInterface::class); + $this->service = self::getContainer()->get(TreeViewGenerator::class); + $this->em = self::getContainer()->get(EntityManagerInterface::class); } public function testGetGenericTree(): void diff --git a/tests/Services/UserSystem/TFA/BackupCodeManagerTest.php b/tests/Services/UserSystem/TFA/BackupCodeManagerTest.php index 8d348d55..6e2b744a 100644 --- a/tests/Services/UserSystem/TFA/BackupCodeManagerTest.php +++ b/tests/Services/UserSystem/TFA/BackupCodeManagerTest.php @@ -36,7 +36,7 @@ class BackupCodeManagerTest extends WebTestCase protected function setUp(): void { self::bootKernel(); - $this->service = self::$container->get(BackupCodeManager::class); + $this->service = self::getContainer()->get(BackupCodeManager::class); } public function testRegenerateBackupCodes(): void