From 98dc5539388812a912a9ba3890abde62bdd424f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 11 Jun 2023 14:18:53 +0200 Subject: [PATCH] Applied rector to test files --- .../AttachmentTypeControllerTest.php | 2 +- .../AdminPages/CategoryControllerTest.php | 2 +- .../AdminPages/FootprintControllerTest.php | 2 +- .../AdminPages/LabelProfileControllerTest.php | 2 +- .../AdminPages/ManufacturerControllerTest.php | 2 +- .../MeasurementUnitControllerTest.php | 2 +- .../AdminPages/ProjectControllerTest.php | 2 +- .../StorelocationControllerTest.php | 2 +- .../AdminPages/SupplierControllerTest.php | 2 +- tests/Controller/RedirectControllerTest.php | 8 ++----- .../Filters/CompoundFilterTraitTest.php | 24 ++++--------------- tests/Entity/Attachments/AttachmentTest.php | 2 +- .../Base/AbstractStructuralDBElementTest.php | 2 +- tests/Entity/Parts/PartTest.php | 6 ++--- .../Projects/ProjectBuildRequestTest.php | 6 ++--- tests/Security/SamlUserFactoryTest.php | 2 +- tests/Serializer/BigNumberNormalizerTest.php | 1 - tests/Serializer/PartNormalizerTest.php | 1 - .../StructuralElementDenormalizerTest.php | 1 - ...ucturalElementFromNameDenormalizerTest.php | 1 - .../StructuralElementNormalizerTest.php | 1 - .../AttachmentPathResolverTest.php | 3 --- .../Services/ElementTypeNameGeneratorTest.php | 2 -- .../Formatters/AmountFormatterTest.php | 4 ++-- .../ImportExportSystem/BOMImporterTest.php | 2 -- .../ImportExportSystem/EntityExporterTest.php | 1 - .../ImportExportSystem/EntityImporterTest.php | 2 -- .../Barcodes/BarcodeContentGeneratorTest.php | 5 +--- .../Barcodes/BarcodeNormalizerTest.php | 6 ++--- .../Barcodes/BarcodeRedirectorTest.php | 7 ++---- .../LabelSystem/LabelTextReplacerTest.php | 2 -- .../LabelSystem/SandboxedTwigProviderTest.php | 5 +--- .../LogSystem/EventCommentHelperTest.php | 2 +- tests/Services/LogSystem/EventLoggerTest.php | 2 +- tests/Services/Misc/FAIconGeneratorTest.php | 2 +- .../Parameters/ParameterExtractorTest.php | 1 - .../Parts/PartLotWithdrawAddHelperTest.php | 1 - .../Services/Parts/PricedetailHelperTest.php | 1 - .../ProjectSystem/ProjectBuildHelperTest.php | 1 - .../ProjectBuildPartHelperTest.php | 1 - .../Services/Trees/TreeViewGeneratorTest.php | 2 +- .../UserSystem/PermissionManagerTest.php | 2 +- .../PermissionSchemaUpdaterTest.php | 6 +---- tests/Twig/EntityExtensionTest.php | 2 +- tests/Twig/TwigCoreExtensionTest.php | 6 ++--- tests/Twig/UserExtensionTest.php | 3 --- 46 files changed, 42 insertions(+), 102 deletions(-) diff --git a/tests/Controller/AdminPages/AttachmentTypeControllerTest.php b/tests/Controller/AdminPages/AttachmentTypeControllerTest.php index e4b47069..b98650bf 100644 --- a/tests/Controller/AdminPages/AttachmentTypeControllerTest.php +++ b/tests/Controller/AdminPages/AttachmentTypeControllerTest.php @@ -30,6 +30,6 @@ use App\Entity\Attachments\AttachmentType; */ class AttachmentTypeControllerTest extends AbstractAdminControllerTest { - protected static string $base_path = '/en'.'/attachment_type'; + protected static string $base_path = '/en/attachment_type'; protected static string $entity_class = AttachmentType::class; } diff --git a/tests/Controller/AdminPages/CategoryControllerTest.php b/tests/Controller/AdminPages/CategoryControllerTest.php index df4de1bd..aa325b31 100644 --- a/tests/Controller/AdminPages/CategoryControllerTest.php +++ b/tests/Controller/AdminPages/CategoryControllerTest.php @@ -30,6 +30,6 @@ use App\Entity\Parts\Category; */ class CategoryControllerTest extends AbstractAdminControllerTest { - protected static string $base_path = '/en'.'/category'; + protected static string $base_path = '/en/category'; protected static string $entity_class = Category::class; } diff --git a/tests/Controller/AdminPages/FootprintControllerTest.php b/tests/Controller/AdminPages/FootprintControllerTest.php index 972248c9..6381ecd6 100644 --- a/tests/Controller/AdminPages/FootprintControllerTest.php +++ b/tests/Controller/AdminPages/FootprintControllerTest.php @@ -30,6 +30,6 @@ use App\Entity\Parts\Footprint; */ class FootprintControllerTest extends AbstractAdminControllerTest { - protected static string $base_path = '/en'.'/footprint'; + protected static string $base_path = '/en/footprint'; protected static string $entity_class = Footprint::class; } diff --git a/tests/Controller/AdminPages/LabelProfileControllerTest.php b/tests/Controller/AdminPages/LabelProfileControllerTest.php index 0a59ffcc..b4ce79cc 100644 --- a/tests/Controller/AdminPages/LabelProfileControllerTest.php +++ b/tests/Controller/AdminPages/LabelProfileControllerTest.php @@ -46,7 +46,7 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; class LabelProfileControllerTest extends AbstractAdminControllerTest { - protected static string $base_path = '/en'.'/label_profile'; + protected static string $base_path = '/en/label_profile'; protected static string $entity_class = LabelProfile::class; /** diff --git a/tests/Controller/AdminPages/ManufacturerControllerTest.php b/tests/Controller/AdminPages/ManufacturerControllerTest.php index d66441c9..d454c604 100644 --- a/tests/Controller/AdminPages/ManufacturerControllerTest.php +++ b/tests/Controller/AdminPages/ManufacturerControllerTest.php @@ -30,6 +30,6 @@ use App\Entity\Parts\Manufacturer; */ class ManufacturerControllerTest extends AbstractAdminControllerTest { - protected static string $base_path = '/en'.'/manufacturer'; + protected static string $base_path = '/en/manufacturer'; protected static string $entity_class = Manufacturer::class; } diff --git a/tests/Controller/AdminPages/MeasurementUnitControllerTest.php b/tests/Controller/AdminPages/MeasurementUnitControllerTest.php index 62a90cc4..83eec70b 100644 --- a/tests/Controller/AdminPages/MeasurementUnitControllerTest.php +++ b/tests/Controller/AdminPages/MeasurementUnitControllerTest.php @@ -30,6 +30,6 @@ use App\Entity\Parts\MeasurementUnit; */ class MeasurementUnitControllerTest extends AbstractAdminControllerTest { - protected static string $base_path = '/en'.'/measurement_unit'; + protected static string $base_path = '/en/measurement_unit'; protected static string $entity_class = MeasurementUnit::class; } diff --git a/tests/Controller/AdminPages/ProjectControllerTest.php b/tests/Controller/AdminPages/ProjectControllerTest.php index 01588e52..c0f5c288 100644 --- a/tests/Controller/AdminPages/ProjectControllerTest.php +++ b/tests/Controller/AdminPages/ProjectControllerTest.php @@ -31,6 +31,6 @@ use App\Entity\ProjectSystem\Project; */ class ProjectControllerTest extends AbstractAdminControllerTest { - protected static string $base_path = '/en'.'/project'; + protected static string $base_path = '/en/project'; protected static string $entity_class = Project::class; } diff --git a/tests/Controller/AdminPages/StorelocationControllerTest.php b/tests/Controller/AdminPages/StorelocationControllerTest.php index bcfd3212..fd8d1e8c 100644 --- a/tests/Controller/AdminPages/StorelocationControllerTest.php +++ b/tests/Controller/AdminPages/StorelocationControllerTest.php @@ -30,6 +30,6 @@ use App\Entity\Parts\Storelocation; */ class StorelocationControllerTest extends AbstractAdminControllerTest { - protected static string $base_path = '/en'.'/store_location'; + protected static string $base_path = '/en/store_location'; protected static string $entity_class = Storelocation::class; } diff --git a/tests/Controller/AdminPages/SupplierControllerTest.php b/tests/Controller/AdminPages/SupplierControllerTest.php index f2c3e066..d98a7f69 100644 --- a/tests/Controller/AdminPages/SupplierControllerTest.php +++ b/tests/Controller/AdminPages/SupplierControllerTest.php @@ -30,6 +30,6 @@ use App\Entity\Parts\Supplier; */ class SupplierControllerTest extends AbstractAdminControllerTest { - protected static string $base_path = '/en'.'/supplier'; + protected static string $base_path = '/en/supplier'; protected static string $entity_class = Supplier::class; } diff --git a/tests/Controller/RedirectControllerTest.php b/tests/Controller/RedirectControllerTest.php index 70dd6f14..90fa63b1 100644 --- a/tests/Controller/RedirectControllerTest.php +++ b/tests/Controller/RedirectControllerTest.php @@ -75,7 +75,7 @@ class RedirectControllerTest extends WebTestCase $this->client->request('GET', $url); $response = $this->client->getResponse(); if ($expect_redirect) { - $this->assertSame(302, $response->getStatusCode()); + $this->assertResponseStatusCodeSame(302); } $this->assertSame($expect_redirect, $response->isRedirect()); } @@ -104,10 +104,6 @@ class RedirectControllerTest extends WebTestCase * @dataProvider urlAddLocaleDataProvider * @group slow * @depends testUrlMatch - * - * @param string|null $user_locale - * @param string $input_path - * @param string $redirect_path */ public function testAddLocale(?string $user_locale, string $input_path, string $redirect_path): void { @@ -122,6 +118,6 @@ class RedirectControllerTest extends WebTestCase $this->client->followRedirects(false); $this->client->request('GET', $input_path); - $this->assertSame($redirect_path, $this->client->getResponse()->headers->get('Location')); + $this->assertResponseRedirects($redirect_path); } } diff --git a/tests/DataTables/Filters/CompoundFilterTraitTest.php b/tests/DataTables/Filters/CompoundFilterTraitTest.php index 455d7da5..e73e639a 100644 --- a/tests/DataTables/Filters/CompoundFilterTraitTest.php +++ b/tests/DataTables/Filters/CompoundFilterTraitTest.php @@ -54,16 +54,8 @@ class CompoundFilterTraitTest extends TestCase $filter = new class($f1, $f2, $f3, null) { use CompoundFilterTrait; - protected $filter1; - private $filter2; - public $filter3; - protected $filter4; - - public function __construct($f1, $f2, $f3, $f4) { - $this->filter1 = $f1; - $this->filter2 = $f2; - $this->filter3 = $f3; - $this->filter4 = $f4; + public function __construct(protected $filter1, private $filter2, public $filter3, protected $filter4) + { } public function _findAllChildFilters() @@ -104,16 +96,8 @@ class CompoundFilterTraitTest extends TestCase $filter = new class($f1, $f2, $f3, null) { use CompoundFilterTrait; - protected $filter1; - private $filter2; - public $filter3; - protected $filter4; - - public function __construct($f1, $f2, $f3, $f4) { - $this->filter1 = $f1; - $this->filter2 = $f2; - $this->filter3 = $f3; - $this->filter4 = $f4; + public function __construct(protected $filter1, private $filter2, public $filter3, protected $filter4) + { } public function _applyAllChildFilters(QueryBuilder $queryBuilder): void diff --git a/tests/Entity/Attachments/AttachmentTest.php b/tests/Entity/Attachments/AttachmentTest.php index 3ef8f4da..ef10dc24 100644 --- a/tests/Entity/Attachments/AttachmentTest.php +++ b/tests/Entity/Attachments/AttachmentTest.php @@ -282,7 +282,7 @@ class AttachmentTest extends TestCase * @param string $property - property on instance being modified * @param mixed $value - new value of the property being modified */ - public function setProtectedProperty(object $object, string $property, $value): void + public function setProtectedProperty(object $object, string $property, mixed $value): void { $reflection = new ReflectionClass($object); $reflection_property = $reflection->getProperty($property); diff --git a/tests/Entity/Base/AbstractStructuralDBElementTest.php b/tests/Entity/Base/AbstractStructuralDBElementTest.php index dca3f25b..3f8157ad 100644 --- a/tests/Entity/Base/AbstractStructuralDBElementTest.php +++ b/tests/Entity/Base/AbstractStructuralDBElementTest.php @@ -42,7 +42,7 @@ class AbstractStructuralDBElementTest extends TestCase protected function setUp(): void { - parent::setUp(); // TODO: Change the autogenerated stub + // TODO: Change the autogenerated stub //Build a simple hierachy $this->root = new AttachmentType(); diff --git a/tests/Entity/Parts/PartTest.php b/tests/Entity/Parts/PartTest.php index 2adc264c..275d39d2 100644 --- a/tests/Entity/Parts/PartTest.php +++ b/tests/Entity/Parts/PartTest.php @@ -104,9 +104,9 @@ class PartTest extends TestCase $this->assertSame(13.141, $part->getAmountSum()); //1 billion part lot - $part->addPartLot((new PartLot())->setAmount(1000000000)); - $this->assertSame(1000000013.141, $part->getAmountSum()); + $part->addPartLot((new PartLot())->setAmount(1_000_000_000)); + $this->assertSame(1_000_000_013.141, $part->getAmountSum()); $measurement_unit->setIsInteger(true); - $this->assertSame(1000000013.0, $part->getAmountSum()); + $this->assertSame(1_000_000_013.0, $part->getAmountSum()); } } diff --git a/tests/Helpers/Projects/ProjectBuildRequestTest.php b/tests/Helpers/Projects/ProjectBuildRequestTest.php index ad14035c..25446697 100644 --- a/tests/Helpers/Projects/ProjectBuildRequestTest.php +++ b/tests/Helpers/Projects/ProjectBuildRequestTest.php @@ -43,10 +43,8 @@ class ProjectBuildRequestTest extends TestCase /** @var ProjectBOMEntry */ private ProjectBOMEntry $bom_entry1c; - /** @var PartLot $lot1a */ - private $lot1a; - /** @var PartLot $lot1b */ - private $lot1b; + private \App\Entity\Parts\PartLot $lot1a; + private \App\Entity\Parts\PartLot $lot1b; private PartLot $lot2; /** @var Part */ diff --git a/tests/Security/SamlUserFactoryTest.php b/tests/Security/SamlUserFactoryTest.php index cb6fbfac..57031c5d 100644 --- a/tests/Security/SamlUserFactoryTest.php +++ b/tests/Security/SamlUserFactoryTest.php @@ -47,7 +47,7 @@ class SamlUserFactoryTest extends WebTestCase $this->assertInstanceOf(User::class, $user); - $this->assertEquals('sso_user', $user->getUsername()); + $this->assertEquals('sso_user', $user->getUserIdentifier()); //User must not change his password $this->assertFalse($user->isNeedPwChange()); //And must not be disabled diff --git a/tests/Serializer/BigNumberNormalizerTest.php b/tests/Serializer/BigNumberNormalizerTest.php index b98968fe..c0cb6070 100644 --- a/tests/Serializer/BigNumberNormalizerTest.php +++ b/tests/Serializer/BigNumberNormalizerTest.php @@ -33,7 +33,6 @@ class BigNumberNormalizerTest extends WebTestCase protected function setUp(): void { - parent::setUp(); //Get an service instance. self::bootKernel(); $this->service = self::getContainer()->get(BigNumberNormalizer::class); diff --git a/tests/Serializer/PartNormalizerTest.php b/tests/Serializer/PartNormalizerTest.php index e9abca16..f19d4c6b 100644 --- a/tests/Serializer/PartNormalizerTest.php +++ b/tests/Serializer/PartNormalizerTest.php @@ -34,7 +34,6 @@ class PartNormalizerTest extends WebTestCase protected function setUp(): void { - parent::setUp(); //Get a service instance. self::bootKernel(); $this->service = self::getContainer()->get(PartNormalizer::class); diff --git a/tests/Serializer/StructuralElementDenormalizerTest.php b/tests/Serializer/StructuralElementDenormalizerTest.php index d9000fb9..624b30d4 100644 --- a/tests/Serializer/StructuralElementDenormalizerTest.php +++ b/tests/Serializer/StructuralElementDenormalizerTest.php @@ -32,7 +32,6 @@ class StructuralElementDenormalizerTest extends WebTestCase protected function setUp(): void { - parent::setUp(); //Get a service instance. self::bootKernel(); $this->service = self::getContainer()->get(StructuralElementDenormalizer::class); diff --git a/tests/Serializer/StructuralElementFromNameDenormalizerTest.php b/tests/Serializer/StructuralElementFromNameDenormalizerTest.php index f4b4b7d5..4349c2a7 100644 --- a/tests/Serializer/StructuralElementFromNameDenormalizerTest.php +++ b/tests/Serializer/StructuralElementFromNameDenormalizerTest.php @@ -32,7 +32,6 @@ class StructuralElementFromNameDenormalizerTest extends WebTestCase protected function setUp(): void { - parent::setUp(); //Get a service instance. self::bootKernel(); $this->service = self::getContainer()->get(StructuralElementFromNameDenormalizer::class); diff --git a/tests/Serializer/StructuralElementNormalizerTest.php b/tests/Serializer/StructuralElementNormalizerTest.php index cc5f996d..0974e670 100644 --- a/tests/Serializer/StructuralElementNormalizerTest.php +++ b/tests/Serializer/StructuralElementNormalizerTest.php @@ -36,7 +36,6 @@ class StructuralElementNormalizerTest extends WebTestCase protected function setUp(): void { - parent::setUp(); //Get an service instance. self::bootKernel(); $this->service = self::getContainer()->get(StructuralElementNormalizer::class); diff --git a/tests/Services/Attachments/AttachmentPathResolverTest.php b/tests/Services/Attachments/AttachmentPathResolverTest.php index 6827e90a..22809390 100644 --- a/tests/Services/Attachments/AttachmentPathResolverTest.php +++ b/tests/Services/Attachments/AttachmentPathResolverTest.php @@ -40,8 +40,6 @@ class AttachmentPathResolverTest extends WebTestCase public function setUp(): void { - parent::setUp(); - //Get a service instance. self::bootKernel(); @@ -161,7 +159,6 @@ class AttachmentPathResolverTest extends WebTestCase /** * @dataProvider germanFootprintPathdDataProvider - * @return void */ public function testConversionOfGermanFootprintPaths(string $expected, string $input): void { diff --git a/tests/Services/ElementTypeNameGeneratorTest.php b/tests/Services/ElementTypeNameGeneratorTest.php index a8a385b6..934a3bbd 100644 --- a/tests/Services/ElementTypeNameGeneratorTest.php +++ b/tests/Services/ElementTypeNameGeneratorTest.php @@ -41,8 +41,6 @@ class ElementTypeNameGeneratorTest extends WebTestCase protected function setUp(): void { - parent::setUp(); - //Get an service instance. $this->service = self::getContainer()->get(ElementTypeNameGenerator::class); } diff --git a/tests/Services/Formatters/AmountFormatterTest.php b/tests/Services/Formatters/AmountFormatterTest.php index 62ded8fe..40f9b7cf 100644 --- a/tests/Services/Formatters/AmountFormatterTest.php +++ b/tests/Services/Formatters/AmountFormatterTest.php @@ -36,7 +36,7 @@ class AmountFormatterTest extends WebTestCase protected function setUp(): void { - parent::setUp(); // TODO: Change the autogenerated stub + // TODO: Change the autogenerated stub //Get a service instance. self::bootKernel(); @@ -47,7 +47,7 @@ class AmountFormatterTest extends WebTestCase { $this->assertSame('2', $this->service->format(2.321)); $this->assertSame('1002', $this->service->format(1002.356)); - $this->assertSame('1000454', $this->service->format(1000454.0)); + $this->assertSame('1000454', $this->service->format(1_000_454.0)); $this->assertSame('0', $this->service->format(0.01)); $this->assertSame('0', $this->service->format(0)); } diff --git a/tests/Services/ImportExportSystem/BOMImporterTest.php b/tests/Services/ImportExportSystem/BOMImporterTest.php index 2a0013e5..194e23f1 100644 --- a/tests/Services/ImportExportSystem/BOMImporterTest.php +++ b/tests/Services/ImportExportSystem/BOMImporterTest.php @@ -36,8 +36,6 @@ class BOMImporterTest extends WebTestCase protected function setUp(): void { - parent::setUp(); - //Get a service instance. self::bootKernel(); $this->service = self::getContainer()->get(BOMImporter::class); diff --git a/tests/Services/ImportExportSystem/EntityExporterTest.php b/tests/Services/ImportExportSystem/EntityExporterTest.php index cbe11ad3..b57b22a3 100644 --- a/tests/Services/ImportExportSystem/EntityExporterTest.php +++ b/tests/Services/ImportExportSystem/EntityExporterTest.php @@ -34,7 +34,6 @@ class EntityExporterTest extends WebTestCase protected function setUp(): void { - parent::setUp(); self::bootKernel(); $this->service = self::getContainer()->get(EntityExporter::class); } diff --git a/tests/Services/ImportExportSystem/EntityImporterTest.php b/tests/Services/ImportExportSystem/EntityImporterTest.php index 50060c13..d6eeeb09 100644 --- a/tests/Services/ImportExportSystem/EntityImporterTest.php +++ b/tests/Services/ImportExportSystem/EntityImporterTest.php @@ -42,8 +42,6 @@ class EntityImporterTest extends WebTestCase protected function setUp(): void { - parent::setUp(); - //Get a service instance. self::bootKernel(); $this->service = self::getContainer()->get(EntityImporter::class); diff --git a/tests/Services/LabelSystem/Barcodes/BarcodeContentGeneratorTest.php b/tests/Services/LabelSystem/Barcodes/BarcodeContentGeneratorTest.php index fe98ccdf..f6597ffb 100644 --- a/tests/Services/LabelSystem/Barcodes/BarcodeContentGeneratorTest.php +++ b/tests/Services/LabelSystem/Barcodes/BarcodeContentGeneratorTest.php @@ -49,10 +49,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; class BarcodeContentGeneratorTest extends KernelTestCase { - /** - * @var BarcodeContentGenerator - */ - private $service; + private ?object $service = null; protected function setUp(): void { diff --git a/tests/Services/LabelSystem/Barcodes/BarcodeNormalizerTest.php b/tests/Services/LabelSystem/Barcodes/BarcodeNormalizerTest.php index b8d34cc0..c1a8ea11 100644 --- a/tests/Services/LabelSystem/Barcodes/BarcodeNormalizerTest.php +++ b/tests/Services/LabelSystem/Barcodes/BarcodeNormalizerTest.php @@ -75,14 +75,14 @@ class BarcodeNormalizerTest extends WebTestCase [['lot', 10], 'Lß000010'], [['part', 123], 'P-000123'], [['location', 123], 'S-000123'], - [['lot', 12345678], 'L-12345678'], + [['lot', 12_345_678], 'L-12345678'], //Legacy storelocation format [['location', 336], '$L00336'], - [['location', 12345678], '$L12345678'], + [['location', 12_345_678], '$L12345678'], //Legacy Part format [['part', 123], '0000123'], [['part', 123], '00001236'], - [['part', 1234567], '12345678'], + [['part', 1_234_567], '12345678'], ]; } diff --git a/tests/Services/LabelSystem/Barcodes/BarcodeRedirectorTest.php b/tests/Services/LabelSystem/Barcodes/BarcodeRedirectorTest.php index 5e7a7ad8..dbbd958c 100644 --- a/tests/Services/LabelSystem/Barcodes/BarcodeRedirectorTest.php +++ b/tests/Services/LabelSystem/Barcodes/BarcodeRedirectorTest.php @@ -47,10 +47,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; class BarcodeRedirectorTest extends KernelTestCase { - /** - * @var BarcodeRedirector - */ - private $service; + private ?object $service = null; protected function setUp(): void { @@ -81,7 +78,7 @@ class BarcodeRedirectorTest extends KernelTestCase { $this->expectException(EntityNotFoundException::class); //If we encounter an invalid lot, we must throw an exception - $this->service->getRedirectURL('lot', 12345678); + $this->service->getRedirectURL('lot', 12_345_678); } public function testInvalidType(): void diff --git a/tests/Services/LabelSystem/LabelTextReplacerTest.php b/tests/Services/LabelSystem/LabelTextReplacerTest.php index e965fcc1..0d9aa3ae 100644 --- a/tests/Services/LabelSystem/LabelTextReplacerTest.php +++ b/tests/Services/LabelSystem/LabelTextReplacerTest.php @@ -60,8 +60,6 @@ class LabelTextReplacerTest extends WebTestCase protected function setUp(): void { - parent::setUp(); - //Get a service instance. self::bootKernel(); $this->service = self::getContainer()->get(LabelTextReplacer::class); diff --git a/tests/Services/LabelSystem/SandboxedTwigProviderTest.php b/tests/Services/LabelSystem/SandboxedTwigProviderTest.php index 1d65d382..9127ea9f 100644 --- a/tests/Services/LabelSystem/SandboxedTwigProviderTest.php +++ b/tests/Services/LabelSystem/SandboxedTwigProviderTest.php @@ -51,10 +51,7 @@ use Twig\Sandbox\SecurityError; class SandboxedTwigProviderTest extends WebTestCase { - /** - * @var SandboxedTwigProvider - */ - private $service; + private ?object $service = null; protected function setUp(): void { diff --git a/tests/Services/LogSystem/EventCommentHelperTest.php b/tests/Services/LogSystem/EventCommentHelperTest.php index 62cca6a2..9c78d4c6 100644 --- a/tests/Services/LogSystem/EventCommentHelperTest.php +++ b/tests/Services/LogSystem/EventCommentHelperTest.php @@ -53,7 +53,7 @@ class EventCommentHelperTest extends WebTestCase protected function setUp(): void { - parent::setUp(); // TODO: Change the autogenerated stub + // TODO: Change the autogenerated stub //Get a service instance. self::bootKernel(); diff --git a/tests/Services/LogSystem/EventLoggerTest.php b/tests/Services/LogSystem/EventLoggerTest.php index 0c94d8c7..cb74adb4 100644 --- a/tests/Services/LogSystem/EventLoggerTest.php +++ b/tests/Services/LogSystem/EventLoggerTest.php @@ -56,7 +56,7 @@ class EventLoggerTest extends WebTestCase protected function setUp(): void { - parent::setUp(); // TODO: Change the autogenerated stub + // TODO: Change the autogenerated stub //Get a service instance. self::bootKernel(); diff --git a/tests/Services/Misc/FAIconGeneratorTest.php b/tests/Services/Misc/FAIconGeneratorTest.php index 34806bf9..4ca318d0 100644 --- a/tests/Services/Misc/FAIconGeneratorTest.php +++ b/tests/Services/Misc/FAIconGeneratorTest.php @@ -34,7 +34,7 @@ class FAIconGeneratorTest extends WebTestCase protected function setUp(): void { - parent::setUp(); // TODO: Change the autogenerated stub + // TODO: Change the autogenerated stub //Get a service instance. self::bootKernel(); diff --git a/tests/Services/Parameters/ParameterExtractorTest.php b/tests/Services/Parameters/ParameterExtractorTest.php index 98393674..e82d99af 100644 --- a/tests/Services/Parameters/ParameterExtractorTest.php +++ b/tests/Services/Parameters/ParameterExtractorTest.php @@ -51,7 +51,6 @@ class ParameterExtractorTest extends WebTestCase protected function setUp(): void { - parent::setUp(); //Get a service instance. self::bootKernel(); $this->service = self::getContainer()->get(ParameterExtractor::class); diff --git a/tests/Services/Parts/PartLotWithdrawAddHelperTest.php b/tests/Services/Parts/PartLotWithdrawAddHelperTest.php index 269a06f9..e3f76785 100644 --- a/tests/Services/Parts/PartLotWithdrawAddHelperTest.php +++ b/tests/Services/Parts/PartLotWithdrawAddHelperTest.php @@ -46,7 +46,6 @@ class PartLotWithdrawAddHelperTest extends WebTestCase protected function setUp(): void { - parent::setUp(); //Get a service instance. self::bootKernel(); $this->service = self::getContainer()->get(PartLotWithdrawAddHelper::class); diff --git a/tests/Services/Parts/PricedetailHelperTest.php b/tests/Services/Parts/PricedetailHelperTest.php index 89931acf..cfb4a043 100644 --- a/tests/Services/Parts/PricedetailHelperTest.php +++ b/tests/Services/Parts/PricedetailHelperTest.php @@ -38,7 +38,6 @@ class PricedetailHelperTest extends WebTestCase protected function setUp(): void { - parent::setUp(); //Get a service instance. self::bootKernel(); $this->service = self::getContainer()->get(PricedetailHelper::class); diff --git a/tests/Services/ProjectSystem/ProjectBuildHelperTest.php b/tests/Services/ProjectSystem/ProjectBuildHelperTest.php index 199a7dac..ef249deb 100644 --- a/tests/Services/ProjectSystem/ProjectBuildHelperTest.php +++ b/tests/Services/ProjectSystem/ProjectBuildHelperTest.php @@ -34,7 +34,6 @@ class ProjectBuildHelperTest extends WebTestCase protected function setUp(): void { - parent::setUp(); self::bootKernel(); $this->service = self::getContainer()->get(ProjectBuildHelper::class); } diff --git a/tests/Services/ProjectSystem/ProjectBuildPartHelperTest.php b/tests/Services/ProjectSystem/ProjectBuildPartHelperTest.php index d0ae8959..92c22b44 100644 --- a/tests/Services/ProjectSystem/ProjectBuildPartHelperTest.php +++ b/tests/Services/ProjectSystem/ProjectBuildPartHelperTest.php @@ -31,7 +31,6 @@ class ProjectBuildPartHelperTest extends WebTestCase protected function setUp(): void { - parent::setUp(); self::bootKernel(); $this->service = self::getContainer()->get(ProjectBuildPartHelper::class); } diff --git a/tests/Services/Trees/TreeViewGeneratorTest.php b/tests/Services/Trees/TreeViewGeneratorTest.php index 92ba196d..f34c855d 100644 --- a/tests/Services/Trees/TreeViewGeneratorTest.php +++ b/tests/Services/Trees/TreeViewGeneratorTest.php @@ -42,7 +42,7 @@ class TreeViewGeneratorTest extends WebTestCase protected function setUp(): void { - parent::setUp(); // TODO: Change the autogenerated stub + // TODO: Change the autogenerated stub //Get a service instance. self::bootKernel(); diff --git a/tests/Services/UserSystem/PermissionManagerTest.php b/tests/Services/UserSystem/PermissionManagerTest.php index 8e90715e..d9c694fe 100644 --- a/tests/Services/UserSystem/PermissionManagerTest.php +++ b/tests/Services/UserSystem/PermissionManagerTest.php @@ -43,7 +43,7 @@ class PermissionManagerTest extends WebTestCase protected function setUp(): void { - parent::setUp(); // TODO: Change the autogenerated stub + // TODO: Change the autogenerated stub //Get a service instance. self::bootKernel(); diff --git a/tests/Services/UserSystem/PermissionSchemaUpdaterTest.php b/tests/Services/UserSystem/PermissionSchemaUpdaterTest.php index 8fe99b50..249c8f46 100644 --- a/tests/Services/UserSystem/PermissionSchemaUpdaterTest.php +++ b/tests/Services/UserSystem/PermissionSchemaUpdaterTest.php @@ -27,11 +27,8 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class TestPermissionHolder implements HasPermissionsInterface { - private PermissionData $perm_data; - - public function __construct(PermissionData $perm_data) + public function __construct(private readonly PermissionData $perm_data) { - $this->perm_data = $perm_data; } public function getPermissions(): PermissionData @@ -49,7 +46,6 @@ class PermissionSchemaUpdaterTest extends WebTestCase public function setUp(): void { - parent::setUp(); self::bootKernel(); $this->service = self::getContainer()->get(PermissionSchemaUpdater::class); diff --git a/tests/Twig/EntityExtensionTest.php b/tests/Twig/EntityExtensionTest.php index 122165bc..99ad8428 100644 --- a/tests/Twig/EntityExtensionTest.php +++ b/tests/Twig/EntityExtensionTest.php @@ -43,7 +43,7 @@ class EntityExtensionTest extends WebTestCase protected function setUp(): void { - parent::setUp(); // TODO: Change the autogenerated stub + // TODO: Change the autogenerated stub //Get a service instance. self::bootKernel(); diff --git a/tests/Twig/TwigCoreExtensionTest.php b/tests/Twig/TwigCoreExtensionTest.php index ed55dcbc..67961fe1 100644 --- a/tests/Twig/TwigCoreExtensionTest.php +++ b/tests/Twig/TwigCoreExtensionTest.php @@ -31,7 +31,7 @@ class TwigCoreExtensionTest extends WebTestCase protected function setUp(): void { - parent::setUp(); // TODO: Change the autogenerated stub + // TODO: Change the autogenerated stub //Get an service instance. self::bootKernel(); @@ -52,8 +52,8 @@ class TwigCoreExtensionTest extends WebTestCase $obj = new class { public $test = 1; protected $test2 = 3; - private $test3 = 5; - private $test4 = 7; + private int $test3 = 5; + private int $test4 = 7; public function getTest4(): int { diff --git a/tests/Twig/UserExtensionTest.php b/tests/Twig/UserExtensionTest.php index 04dd888f..1fa722f6 100644 --- a/tests/Twig/UserExtensionTest.php +++ b/tests/Twig/UserExtensionTest.php @@ -44,9 +44,6 @@ class UserExtensionTest extends WebTestCase /** * @dataProvider removeeLocaleFromPathDataSet - * @param string $expected - * @param string $input - * @return void */ public function testRemoveLocaleFromPath(string $expected, string $input): void {