diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 762c1dcc..0a7c2dcb 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -19,10 +19,7 @@ - - - src - + diff --git a/rector.php b/rector.php index c45fab60..936b447e 100644 --- a/rector.php +++ b/rector.php @@ -37,7 +37,7 @@ return RectorConfig::configure() PHPUnitSetList::PHPUNIT_110, PHPUnitSetList::PHPUNIT_CODE_QUALITY, - + ]) ->withRules([ diff --git a/tests/ApplicationAvailabilityFunctionalTest.php b/tests/ApplicationAvailabilityFunctionalTest.php index 3f5a911e..d5bced49 100644 --- a/tests/ApplicationAvailabilityFunctionalTest.php +++ b/tests/ApplicationAvailabilityFunctionalTest.php @@ -53,7 +53,7 @@ class ApplicationAvailabilityFunctionalTest extends WebTestCase $this->assertTrue($client->getResponse()->isSuccessful(), 'Request not successful. Status code is '.$client->getResponse()->getStatusCode() . ' for URL '.$url); } - public function urlProvider(): ?Generator + public static function urlProvider(): ?Generator { //Homepage yield ['/']; diff --git a/tests/Controller/AdminPages/AbstractAdminControllerTest.php b/tests/Controller/AdminPages/AbstractAdminController.php similarity index 96% rename from tests/Controller/AdminPages/AbstractAdminControllerTest.php rename to tests/Controller/AdminPages/AbstractAdminController.php index ec858e4e..ed08a149 100644 --- a/tests/Controller/AdminPages/AbstractAdminControllerTest.php +++ b/tests/Controller/AdminPages/AbstractAdminController.php @@ -29,12 +29,12 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; #[Group('slow')] #[Group('DB')] -abstract class AbstractAdminControllerTest extends WebTestCase +abstract class AbstractAdminController extends WebTestCase { protected static string $base_path = 'not_valid'; protected static string $entity_class = 'not valid'; - public function readDataProvider(): \Iterator + public static function readDataProvider(): \Iterator { yield ['noread', false]; yield ['anonymous', true]; @@ -99,7 +99,7 @@ abstract class AbstractAdminControllerTest extends WebTestCase $this->assertSame($read, !$client->getResponse()->isForbidden(), 'Permission Checking not working!'); } - public function deleteDataProvider(): \Iterator + public static function deleteDataProvider(): \Iterator { yield ['noread', false]; yield ['anonymous', false]; diff --git a/tests/Controller/AdminPages/AttachmentTypeControllerTest.php b/tests/Controller/AdminPages/AttachmentTypeController.php similarity index 94% rename from tests/Controller/AdminPages/AttachmentTypeControllerTest.php rename to tests/Controller/AdminPages/AttachmentTypeController.php index 0a5b0f6d..599a6f69 100644 --- a/tests/Controller/AdminPages/AttachmentTypeControllerTest.php +++ b/tests/Controller/AdminPages/AttachmentTypeController.php @@ -27,7 +27,7 @@ use App\Entity\Attachments\AttachmentType; #[Group('slow')] #[Group('DB')] -class AttachmentTypeControllerTest extends AbstractAdminControllerTest +class AttachmentTypeController extends AbstractAdminController { 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/CategoryController.php similarity index 94% rename from tests/Controller/AdminPages/CategoryControllerTest.php rename to tests/Controller/AdminPages/CategoryController.php index 81a251b9..c1bac093 100644 --- a/tests/Controller/AdminPages/CategoryControllerTest.php +++ b/tests/Controller/AdminPages/CategoryController.php @@ -27,7 +27,7 @@ use App\Entity\Parts\Category; #[Group('slow')] #[Group('DB')] -class CategoryControllerTest extends AbstractAdminControllerTest +class CategoryController extends AbstractAdminController { 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/FootprintController.php similarity index 94% rename from tests/Controller/AdminPages/FootprintControllerTest.php rename to tests/Controller/AdminPages/FootprintController.php index 64b4164e..7d617ba8 100644 --- a/tests/Controller/AdminPages/FootprintControllerTest.php +++ b/tests/Controller/AdminPages/FootprintController.php @@ -27,7 +27,7 @@ use App\Entity\Parts\Footprint; #[Group('slow')] #[Group('DB')] -class FootprintControllerTest extends AbstractAdminControllerTest +class FootprintController extends AbstractAdminController { 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/LabelProfileController.php similarity index 97% rename from tests/Controller/AdminPages/LabelProfileControllerTest.php rename to tests/Controller/AdminPages/LabelProfileController.php index 02d294e5..838d872e 100644 --- a/tests/Controller/AdminPages/LabelProfileControllerTest.php +++ b/tests/Controller/AdminPages/LabelProfileController.php @@ -46,7 +46,7 @@ use PHPUnit\Framework\Attributes\Group; use App\Entity\LabelSystem\LabelProfile; use Symfony\Component\Security\Core\Exception\AccessDeniedException; -class LabelProfileControllerTest extends AbstractAdminControllerTest +class LabelProfileController extends AbstractAdminController { 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/ManufacturerController.php similarity index 94% rename from tests/Controller/AdminPages/ManufacturerControllerTest.php rename to tests/Controller/AdminPages/ManufacturerController.php index 577c19af..c2666f72 100644 --- a/tests/Controller/AdminPages/ManufacturerControllerTest.php +++ b/tests/Controller/AdminPages/ManufacturerController.php @@ -27,7 +27,7 @@ use App\Entity\Parts\Manufacturer; #[Group('slow')] #[Group('DB')] -class ManufacturerControllerTest extends AbstractAdminControllerTest +class ManufacturerController extends AbstractAdminController { 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/MeasurementUnitController.php similarity index 94% rename from tests/Controller/AdminPages/MeasurementUnitControllerTest.php rename to tests/Controller/AdminPages/MeasurementUnitController.php index 4ebfad26..351f4e51 100644 --- a/tests/Controller/AdminPages/MeasurementUnitControllerTest.php +++ b/tests/Controller/AdminPages/MeasurementUnitController.php @@ -27,7 +27,7 @@ use App\Entity\Parts\MeasurementUnit; #[Group('slow')] #[Group('DB')] -class MeasurementUnitControllerTest extends AbstractAdminControllerTest +class MeasurementUnitController extends AbstractAdminController { 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/ProjectController.php similarity index 94% rename from tests/Controller/AdminPages/ProjectControllerTest.php rename to tests/Controller/AdminPages/ProjectController.php index b0a353ae..1de4bf52 100644 --- a/tests/Controller/AdminPages/ProjectControllerTest.php +++ b/tests/Controller/AdminPages/ProjectController.php @@ -28,7 +28,7 @@ use App\Entity\ProjectSystem\Project; #[Group('slow')] #[Group('DB')] -class ProjectControllerTest extends AbstractAdminControllerTest +class ProjectController extends AbstractAdminController { 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/StorelocationController.php similarity index 94% rename from tests/Controller/AdminPages/StorelocationControllerTest.php rename to tests/Controller/AdminPages/StorelocationController.php index 42e57bc5..fee06c67 100644 --- a/tests/Controller/AdminPages/StorelocationControllerTest.php +++ b/tests/Controller/AdminPages/StorelocationController.php @@ -27,7 +27,7 @@ use App\Entity\Parts\StorageLocation; #[Group('slow')] #[Group('DB')] -class StorelocationControllerTest extends AbstractAdminControllerTest +class StorelocationController extends AbstractAdminController { protected static string $base_path = '/en/store_location'; protected static string $entity_class = StorageLocation::class; diff --git a/tests/Controller/AdminPages/SupplierControllerTest.php b/tests/Controller/AdminPages/SupplierController.php similarity index 94% rename from tests/Controller/AdminPages/SupplierControllerTest.php rename to tests/Controller/AdminPages/SupplierController.php index 3a147576..3549eb4b 100644 --- a/tests/Controller/AdminPages/SupplierControllerTest.php +++ b/tests/Controller/AdminPages/SupplierController.php @@ -27,7 +27,7 @@ use App\Entity\Parts\Supplier; #[Group('slow')] #[Group('DB')] -class SupplierControllerTest extends AbstractAdminControllerTest +class SupplierController extends AbstractAdminController { 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 af322c43..ac2776e5 100644 --- a/tests/Controller/RedirectControllerTest.php +++ b/tests/Controller/RedirectControllerTest.php @@ -51,7 +51,7 @@ class RedirectControllerTest extends WebTestCase $this->userRepo = $this->em->getRepository(User::class); } - public function urlMatchDataProvider(): \Iterator + public static function urlMatchDataProvider(): \Iterator { yield ['/', true]; yield ['/part/2/info', true]; @@ -79,7 +79,7 @@ class RedirectControllerTest extends WebTestCase $this->assertSame($expect_redirect, $response->isRedirect()); } - public function urlAddLocaleDataProvider(): \Iterator + public static function urlAddLocaleDataProvider(): \Iterator { //User locale, original target, redirect target yield ['de', '/', '/de/']; diff --git a/tests/DataTables/Filters/Constraints/FilterTraitTest.php b/tests/DataTables/Filters/Constraints/FilterTraitTest.php index c2ec5905..e1e459d5 100644 --- a/tests/DataTables/Filters/Constraints/FilterTraitTest.php +++ b/tests/DataTables/Filters/Constraints/FilterTraitTest.php @@ -41,7 +41,7 @@ class FilterTraitTest extends TestCase $this->assertFalse($this->useHaving); } - public function isAggregateFunctionStringDataProvider(): iterable + public static function isAggregateFunctionStringDataProvider(): iterable { yield [false, 'parts.test']; yield [false, 'attachments.test']; diff --git a/tests/DatatablesAvailabilityTest.php b/tests/DatatablesAvailabilityTest.php index 9e4e7f15..dad61be3 100644 --- a/tests/DatatablesAvailabilityTest.php +++ b/tests/DatatablesAvailabilityTest.php @@ -79,7 +79,7 @@ class DatatablesAvailabilityTest extends WebTestCase $this->assertJson($client->getResponse()->getContent()); } - public function urlProvider(): ?\Generator + public static function urlProvider(): ?\Generator { //Part lists yield ['/category/1/parts']; diff --git a/tests/Doctrine/SQLiteRegexMiddlewareTest.php b/tests/Doctrine/SQLiteRegexMiddlewareTest.php index 6278cc54..67410f76 100644 --- a/tests/Doctrine/SQLiteRegexMiddlewareTest.php +++ b/tests/Doctrine/SQLiteRegexMiddlewareTest.php @@ -29,7 +29,7 @@ use PHPUnit\Framework\TestCase; class SQLiteRegexMiddlewareTest extends TestCase { - public function regexpDataProvider(): \Generator + public static function regexpDataProvider(): \Generator { yield [1, 'a', 'a']; yield [0, 'a', 'b']; @@ -48,7 +48,7 @@ class SQLiteRegexMiddlewareTest extends TestCase $this->assertSame($expected, SQLiteRegexExtensionMiddlewareDriver::regexp($pattern, $value)); } - public function fieldDataProvider(): \Generator + public static function fieldDataProvider(): \Generator { // Null cases diff --git a/tests/Entity/Attachments/AttachmentTest.php b/tests/Entity/Attachments/AttachmentTest.php index d878a689..00a68d7d 100644 --- a/tests/Entity/Attachments/AttachmentTest.php +++ b/tests/Entity/Attachments/AttachmentTest.php @@ -75,7 +75,7 @@ class AttachmentTest extends TestCase $this->assertEmpty($attachment->getFilename()); } - public function subClassesDataProvider(): \Iterator + public static function subClassesDataProvider(): \Iterator { yield [AttachmentTypeAttachment::class, AttachmentType::class]; yield [CategoryAttachment::class, Category::class]; diff --git a/tests/Entity/Parameters/PartParameterTest.php b/tests/Entity/Parameters/PartParameterTest.php index aec471cb..64550eee 100644 --- a/tests/Entity/Parameters/PartParameterTest.php +++ b/tests/Entity/Parameters/PartParameterTest.php @@ -47,7 +47,7 @@ use PHPUnit\Framework\TestCase; class PartParameterTest extends TestCase { - public function valueWithUnitDataProvider(): \Iterator + public static function valueWithUnitDataProvider(): \Iterator { yield ['1', 1.0, '']; yield ['1 V', 1.0, 'V']; @@ -55,7 +55,7 @@ class PartParameterTest extends TestCase yield ['1.23 V', 1.23, 'V']; } - public function formattedValueDataProvider(): \Iterator + public static function formattedValueDataProvider(): \Iterator { yield ['Text Test', null, null, null, 'V', 'Text Test']; yield ['10.23 V', null, 10.23, null, 'V', '']; @@ -68,7 +68,7 @@ class PartParameterTest extends TestCase yield ['10.23 V (9 V ... 11 V) [Test]', 9, 10.23, 11, 'V', 'Test']; } - public function formattedValueWithLatexDataProvider(): \Iterator + public static function formattedValueWithLatexDataProvider(): \Iterator { yield ['Text Test', null, null, null, 'V', 'Text Test']; yield ['10.23 $\mathrm{V}$', null, 10.23, null, 'V', '']; diff --git a/tests/Entity/UserSystem/UserTest.php b/tests/Entity/UserSystem/UserTest.php index bc4dec2d..a4349e1d 100644 --- a/tests/Entity/UserSystem/UserTest.php +++ b/tests/Entity/UserSystem/UserTest.php @@ -47,7 +47,7 @@ class UserTest extends TestCase $this->assertSame('John (@username)', $user->getFullName(true)); } - public function googleAuthenticatorEnabledDataProvider(): \Iterator + public static function googleAuthenticatorEnabledDataProvider(): \Iterator { yield [null, false]; yield ['', false]; @@ -62,7 +62,7 @@ class UserTest extends TestCase $this->assertSame($expected, $user->isGoogleAuthenticatorEnabled()); } - #[RequiresPhpunit('8')] + //#[RequiresPhpunit('8')] public function testSetBackupCodes(): void { $user = new User(); diff --git a/tests/Helpers/BBCodeToMarkdownConverterTest.php b/tests/Helpers/BBCodeToMarkdownConverterTest.php index ad29f959..9506cba4 100644 --- a/tests/Helpers/BBCodeToMarkdownConverterTest.php +++ b/tests/Helpers/BBCodeToMarkdownConverterTest.php @@ -35,7 +35,7 @@ class BBCodeToMarkdownConverterTest extends TestCase $this->converter = new BBCodeToMarkdownConverter(); } - public function dataProvider(): \Iterator + public static function dataProvider(): \Iterator { yield ['[b]Bold[/b]', '**Bold**']; yield ['[i]Italic[/i]', '*Italic*']; diff --git a/tests/Helpers/IPAnonymizerTest.php b/tests/Helpers/IPAnonymizerTest.php index 24994c49..e16368eb 100644 --- a/tests/Helpers/IPAnonymizerTest.php +++ b/tests/Helpers/IPAnonymizerTest.php @@ -29,7 +29,7 @@ use PHPUnit\Framework\TestCase; class IPAnonymizerTest extends TestCase { - public function anonymizeDataProvider(): \Generator + public static function anonymizeDataProvider(): \Generator { yield ['127.0.0.0', '127.0.0.23']; yield ['2001:db8:85a3::', '2001:0db8:85a3:0000:0000:8a2e:0370:7334']; diff --git a/tests/Services/Attachments/AttachmentPathResolverTest.php b/tests/Services/Attachments/AttachmentPathResolverTest.php index b304e645..69658e13 100644 --- a/tests/Services/Attachments/AttachmentPathResolverTest.php +++ b/tests/Services/Attachments/AttachmentPathResolverTest.php @@ -70,19 +70,19 @@ class AttachmentPathResolverTest extends WebTestCase $this->assertNull($this->service->parameterToAbsolutePath('/./this/one/too')); } - public function placeholderDataProvider(): \Iterator + public static function placeholderDataProvider(): \Iterator { //We need to do initialization (again), as dataprovider is called before setUp() self::bootKernel(); - $this->projectDir_orig = realpath(self::$kernel->getProjectDir()); - $this->projectDir = str_replace('\\', '/', $this->projectDir_orig); - $this->media_path = $this->projectDir.'/public/media'; - $this->footprint_path = $this->projectDir.'/public/img/footprints'; - yield ['%FOOTPRINTS%/test/test.jpg', $this->footprint_path.'/test/test.jpg']; - yield ['%FOOTPRINTS%/test/', $this->footprint_path.'/test/']; - yield ['%MEDIA%/test', $this->media_path.'/test']; - yield ['%MEDIA%', $this->media_path]; - yield ['%FOOTPRINTS%', $this->footprint_path]; + $projectDir_orig = realpath(self::$kernel->getProjectDir()); + $projectDir = str_replace('\\', '/', $projectDir_orig); + $media_path = $projectDir.'/public/media'; + $footprint_path = $projectDir.'/public/img/footprints'; + yield ['%FOOTPRINTS%/test/test.jpg', $footprint_path.'/test/test.jpg']; + yield ['%FOOTPRINTS%/test/', $footprint_path.'/test/']; + yield ['%MEDIA%/test', $media_path.'/test']; + yield ['%MEDIA%', $media_path]; + yield ['%FOOTPRINTS%', $footprint_path]; //Footprints 3D are disabled yield ['%FOOTPRINTS_3D%', null]; //Check that invalid pathes return null @@ -99,25 +99,25 @@ class AttachmentPathResolverTest extends WebTestCase yield ['%FOOTPRINTS%/0\..\test', null]; } - public function realPathDataProvider(): \Iterator + public static function realPathDataProvider(): \Iterator { //We need to do initialization (again), as dataprovider is called before setUp() self::bootKernel(); - $this->projectDir_orig = realpath(self::$kernel->getProjectDir()); - $this->projectDir = str_replace('\\', '/', $this->projectDir_orig); - $this->media_path = $this->projectDir.'/public/media'; - $this->footprint_path = $this->projectDir.'/public/img/footprints'; - yield [$this->media_path.'/test/img.jpg', '%MEDIA%/test/img.jpg']; - yield [$this->media_path.'/test/img.jpg', '%BASE%/data/media/test/img.jpg', true]; - yield [$this->footprint_path.'/foo.jpg', '%FOOTPRINTS%/foo.jpg']; - yield [$this->footprint_path.'/foo.jpg', '%FOOTPRINTS%/foo.jpg', true]; + $projectDir_orig = realpath(self::$kernel->getProjectDir()); + $projectDir = str_replace('\\', '/', $projectDir_orig); + $media_path = $projectDir.'/public/media'; + $footprint_path = $projectDir.'/public/img/footprints'; + yield [$media_path.'/test/img.jpg', '%MEDIA%/test/img.jpg']; + yield [$media_path.'/test/img.jpg', '%BASE%/data/media/test/img.jpg', true]; + yield [$footprint_path.'/foo.jpg', '%FOOTPRINTS%/foo.jpg']; + yield [$footprint_path.'/foo.jpg', '%FOOTPRINTS%/foo.jpg', true]; //Every kind of absolute path, that is not based with our placeholder dirs must be invald yield ['/etc/passwd', null]; yield ['C:\\not\\existing.txt', null]; //More than one placeholder is not allowed - yield [$this->footprint_path.'/test/'.$this->footprint_path, null]; + yield [$footprint_path.'/test/'.$footprint_path, null]; //Path must begin with path - yield ['/not/root'.$this->footprint_path, null]; + yield ['/not/root'.$footprint_path, null]; } #[DataProvider('placeholderDataProvider')] @@ -132,23 +132,23 @@ class AttachmentPathResolverTest extends WebTestCase $this->assertSame($expected, $this->service->realPathToPlaceholder($param, $old_method)); } - public function germanFootprintPathdDataProvider(): ?\Generator + public static function germanFootprintPathdDataProvider(): ?\Generator { self::bootKernel(); - $this->projectDir_orig = realpath(self::$kernel->getProjectDir()); - $this->projectDir = str_replace('\\', '/', $this->projectDir_orig); - $this->footprint_path = $this->projectDir.'/public/img/footprints'; + $projectDir_orig = realpath(self::$kernel->getProjectDir()); + $projectDir = str_replace('\\', '/', $projectDir_orig); + $footprint_path = $projectDir.'/public/img/footprints'; - yield [$this->footprint_path. '/Active/Diodes/THT/DIODE_P600.png', '%FOOTPRINTS%/Aktiv/Dioden/Bedrahtet/DIODE_P600.png']; - yield [$this->footprint_path . '/Passive/Resistors/THT/Carbon/RESISTOR-CARBON_0207.png', '%FOOTPRINTS%/Passiv/Widerstaende/Bedrahtet/Kohleschicht/WIDERSTAND-KOHLE_0207.png']; - yield [$this->footprint_path . '/Optics/LEDs/THT/LED-GREEN_3MM.png', '%FOOTPRINTS%/Optik/LEDs/Bedrahtet/LED-GRUEN_3MM.png']; - yield [$this->footprint_path . '/Passive/Capacitors/TrimmerCapacitors/TRIMMER_CAPACITOR-RED_TZ03F.png', '%FOOTPRINTS%/Passiv/Kondensatoren/Trimmkondensatoren/TRIMMKONDENSATOR-ROT_TZ03F.png']; - yield [$this->footprint_path . '/Active/ICs/TO/IC_TO126.png', '%FOOTPRINTS%/Aktiv/ICs/TO/IC_TO126.png']; - yield [$this->footprint_path . '/Electromechanics/Switches_Buttons/RotarySwitches/ROTARY_SWITCH_DIP10.png', '%FOOTPRINTS%/Elektromechanik/Schalter_Taster/Drehschalter/DREHSCHALTER_DIP10.png']; - yield [$this->footprint_path . '/Electromechanics/Connectors/DINConnectors/SOCKET_DIN_MAB_4.png', '%FOOTPRINTS%/Elektromechanik/Verbinder/Rundsteckverbinder/BUCHSE_DIN_MAB_4.png']; + yield [$footprint_path. '/Active/Diodes/THT/DIODE_P600.png', '%FOOTPRINTS%/Aktiv/Dioden/Bedrahtet/DIODE_P600.png']; + yield [$footprint_path . '/Passive/Resistors/THT/Carbon/RESISTOR-CARBON_0207.png', '%FOOTPRINTS%/Passiv/Widerstaende/Bedrahtet/Kohleschicht/WIDERSTAND-KOHLE_0207.png']; + yield [$footprint_path . '/Optics/LEDs/THT/LED-GREEN_3MM.png', '%FOOTPRINTS%/Optik/LEDs/Bedrahtet/LED-GRUEN_3MM.png']; + yield [$footprint_path . '/Passive/Capacitors/TrimmerCapacitors/TRIMMER_CAPACITOR-RED_TZ03F.png', '%FOOTPRINTS%/Passiv/Kondensatoren/Trimmkondensatoren/TRIMMKONDENSATOR-ROT_TZ03F.png']; + yield [$footprint_path . '/Active/ICs/TO/IC_TO126.png', '%FOOTPRINTS%/Aktiv/ICs/TO/IC_TO126.png']; + yield [$footprint_path . '/Electromechanics/Switches_Buttons/RotarySwitches/ROTARY_SWITCH_DIP10.png', '%FOOTPRINTS%/Elektromechanik/Schalter_Taster/Drehschalter/DREHSCHALTER_DIP10.png']; + yield [$footprint_path . '/Electromechanics/Connectors/DINConnectors/SOCKET_DIN_MAB_4.png', '%FOOTPRINTS%/Elektromechanik/Verbinder/Rundsteckverbinder/BUCHSE_DIN_MAB_4.png']; //Leave english pathes untouched - yield [$this->footprint_path . '/Passive/Capacitors/CAPACITOR_CTS_A_15MM.png', '%FOOTPRINTS%/Passive/Capacitors/CAPACITOR_CTS_A_15MM.png']; + yield [$footprint_path . '/Passive/Capacitors/CAPACITOR_CTS_A_15MM.png', '%FOOTPRINTS%/Passive/Capacitors/CAPACITOR_CTS_A_15MM.png']; } #[DataProvider('germanFootprintPathdDataProvider')] diff --git a/tests/Services/Attachments/AttachmentURLGeneratorTest.php b/tests/Services/Attachments/AttachmentURLGeneratorTest.php index 7816f697..e9e6d992 100644 --- a/tests/Services/Attachments/AttachmentURLGeneratorTest.php +++ b/tests/Services/Attachments/AttachmentURLGeneratorTest.php @@ -39,7 +39,7 @@ class AttachmentURLGeneratorTest extends WebTestCase self::$service = self::getContainer()->get(AttachmentURLGenerator::class); } - public function dataProvider(): \Iterator + public static function dataProvider(): \Iterator { yield ['/public/test.jpg', 'test.jpg']; yield ['/public/folder/test.jpg', 'folder/test.jpg']; diff --git a/tests/Services/Attachments/BuiltinAttachmentsFinderTest.php b/tests/Services/Attachments/BuiltinAttachmentsFinderTest.php index 569d84f9..80c699ac 100644 --- a/tests/Services/Attachments/BuiltinAttachmentsFinderTest.php +++ b/tests/Services/Attachments/BuiltinAttachmentsFinderTest.php @@ -44,7 +44,7 @@ class BuiltinAttachmentsFinderTest extends WebTestCase self::$service = self::getContainer()->get(BuiltinAttachmentsFinder::class); } - public function dataProvider(): \Iterator + public static function dataProvider(): \Iterator { //No value should return empty array yield ['', [], []]; diff --git a/tests/Services/Attachments/FileTypeFilterToolsTest.php b/tests/Services/Attachments/FileTypeFilterToolsTest.php index 73002371..1b85eaeb 100644 --- a/tests/Services/Attachments/FileTypeFilterToolsTest.php +++ b/tests/Services/Attachments/FileTypeFilterToolsTest.php @@ -36,7 +36,7 @@ class FileTypeFilterToolsTest extends WebTestCase self::$service = self::getContainer()->get(FileTypeFilterTools::class); } - public function validateDataProvider(): \Iterator + public static function validateDataProvider(): \Iterator { yield ['', true]; //Empty string is valid @@ -55,7 +55,7 @@ class FileTypeFilterToolsTest extends WebTestCase yield ['.png .jpg .gif', false]; } - public function normalizeDataProvider(): \Iterator + public static function normalizeDataProvider(): \Iterator { yield ['', '']; yield ['.jpeg,.png,.gif', '.jpeg,.png,.gif']; @@ -69,7 +69,7 @@ class FileTypeFilterToolsTest extends WebTestCase yield ['png, .gif, .png,', '.png,.gif']; } - public function extensionAllowedDataProvider(): \Iterator + public static function extensionAllowedDataProvider(): \Iterator { yield ['', 'txt', true]; yield ['', 'everything_should_match', true]; diff --git a/tests/Services/ImportExportSystem/EntityImporterTest.php b/tests/Services/ImportExportSystem/EntityImporterTest.php index 8f7d1004..7c6f4d5d 100644 --- a/tests/Services/ImportExportSystem/EntityImporterTest.php +++ b/tests/Services/ImportExportSystem/EntityImporterTest.php @@ -174,7 +174,7 @@ EOT; $this->assertSame($longName, $errors[0]['entity']->getName()); } - public function formatDataProvider(): \Iterator + public static function formatDataProvider(): \Iterator { yield ['csv', 'csv']; yield ['csv', 'CSV']; diff --git a/tests/Services/InfoProviderSystem/DTOs/ParameterDTOTest.php b/tests/Services/InfoProviderSystem/DTOs/ParameterDTOTest.php index 4bc9f5c6..4c4e9bfe 100644 --- a/tests/Services/InfoProviderSystem/DTOs/ParameterDTOTest.php +++ b/tests/Services/InfoProviderSystem/DTOs/ParameterDTOTest.php @@ -29,7 +29,7 @@ use PHPUnit\Framework\TestCase; class ParameterDTOTest extends TestCase { - public function parseValueFieldDataProvider(): \Generator + public static function parseValueFieldDataProvider(): \Generator { //Text value yield [ @@ -132,7 +132,7 @@ class ParameterDTOTest extends TestCase ]; } - public function parseValueIncludingUnitDataProvider(): \Generator + public static function parseValueIncludingUnitDataProvider(): \Generator { //Text value yield [ diff --git a/tests/Services/LabelSystem/Barcodes/BarcodeContentGeneratorTest.php b/tests/Services/LabelSystem/Barcodes/BarcodeContentGeneratorTest.php index ecaa8bf5..69458734 100644 --- a/tests/Services/LabelSystem/Barcodes/BarcodeContentGeneratorTest.php +++ b/tests/Services/LabelSystem/Barcodes/BarcodeContentGeneratorTest.php @@ -58,14 +58,14 @@ class BarcodeContentGeneratorTest extends KernelTestCase $this->service = self::getContainer()->get(BarcodeContentGenerator::class); } - public function Barcode1DDataProvider(): \Iterator + public static function Barcode1DDataProvider(): \Iterator { yield ['P0000', Part::class]; yield ['L0000', PartLot::class]; yield ['S0000', StorageLocation::class]; } - public function Barcode2DDataProvider(): \Iterator + public static function Barcode2DDataProvider(): \Iterator { yield ['/scan/part/0', Part::class]; yield ['/scan/lot/0', PartLot::class]; diff --git a/tests/Services/LabelSystem/LabelTextReplacerTest.php b/tests/Services/LabelSystem/LabelTextReplacerTest.php index 4af74275..346d1bab 100644 --- a/tests/Services/LabelSystem/LabelTextReplacerTest.php +++ b/tests/Services/LabelSystem/LabelTextReplacerTest.php @@ -71,7 +71,7 @@ class LabelTextReplacerTest extends WebTestCase $this->target->setComment('P Comment'); } - public function handlePlaceholderDataProvider(): \Iterator + public static function handlePlaceholderDataProvider(): \Iterator { yield ['Part 1', '[[NAME]]']; yield ['P Description', '[[DESCRIPTION]]']; @@ -83,7 +83,7 @@ class LabelTextReplacerTest extends WebTestCase yield ['Test [[NAME]]', 'Test [[NAME]]', 'Test [[NAME]]']; } - public function replaceDataProvider(): \Iterator + public static function replaceDataProvider(): \Iterator { yield ['Part 1', '[[NAME]]']; yield ['TestPart 1', 'Test[[NAME]]']; diff --git a/tests/Services/LabelSystem/PlaceholderProviders/AbstractElementProviderTest.php b/tests/Services/LabelSystem/PlaceholderProviders/AbstractElementProviderTest.php index 4e902862..fb917b82 100644 --- a/tests/Services/LabelSystem/PlaceholderProviders/AbstractElementProviderTest.php +++ b/tests/Services/LabelSystem/PlaceholderProviders/AbstractElementProviderTest.php @@ -64,7 +64,7 @@ class AbstractElementProviderTest extends WebTestCase }; } - public function dataProvider(): \Iterator + public static function dataProvider(): \Iterator { yield ['123', '[[ID]]']; } diff --git a/tests/Services/LabelSystem/PlaceholderProviders/GlobalProvidersTest.php b/tests/Services/LabelSystem/PlaceholderProviders/GlobalProvidersTest.php index 6f41e057..d74bb215 100644 --- a/tests/Services/LabelSystem/PlaceholderProviders/GlobalProvidersTest.php +++ b/tests/Services/LabelSystem/PlaceholderProviders/GlobalProvidersTest.php @@ -62,7 +62,7 @@ class GlobalProvidersTest extends WebTestCase $this->target = new Part(); } - public function dataProvider(): \Iterator + public static function dataProvider(): \Iterator { yield ['Part-DB', '[[INSTALL_NAME]]']; yield ['anonymous', '[[USERNAME]]']; diff --git a/tests/Services/LabelSystem/PlaceholderProviders/NamedElementProviderTest.php b/tests/Services/LabelSystem/PlaceholderProviders/NamedElementProviderTest.php index 2e333c13..c5efc768 100644 --- a/tests/Services/LabelSystem/PlaceholderProviders/NamedElementProviderTest.php +++ b/tests/Services/LabelSystem/PlaceholderProviders/NamedElementProviderTest.php @@ -67,7 +67,7 @@ class NamedElementProviderTest extends WebTestCase }; } - public function dataProvider(): \Iterator + public static function dataProvider(): \Iterator { yield ['This is my Name', '[[NAME]]']; } diff --git a/tests/Services/LabelSystem/PlaceholderProviders/PartLotProviderTest.php b/tests/Services/LabelSystem/PlaceholderProviders/PartLotProviderTest.php index 8826ddcf..5aa8f1bd 100644 --- a/tests/Services/LabelSystem/PlaceholderProviders/PartLotProviderTest.php +++ b/tests/Services/LabelSystem/PlaceholderProviders/PartLotProviderTest.php @@ -86,7 +86,7 @@ class PartLotProviderTest extends WebTestCase $this->target->setOwner($user); } - public function dataProvider(): \Iterator + public static function dataProvider(): \Iterator { yield ['unknown', '[[LOT_ID]]']; yield ['Lot description', '[[LOT_NAME]]']; diff --git a/tests/Services/LabelSystem/PlaceholderProviders/PartProviderTest.php b/tests/Services/LabelSystem/PlaceholderProviders/PartProviderTest.php index 01cad822..7af936cd 100644 --- a/tests/Services/LabelSystem/PlaceholderProviders/PartProviderTest.php +++ b/tests/Services/LabelSystem/PlaceholderProviders/PartProviderTest.php @@ -87,7 +87,7 @@ class PartProviderTest extends WebTestCase $this->target->setComment('Bold *Italic*'); } - public function dataProvider(): \Iterator + public static function dataProvider(): \Iterator { yield ['Node 2.1', '[[CATEGORY]]']; yield ['Node 2 → Node 2.1', '[[CATEGORY_FULL]]']; diff --git a/tests/Services/LabelSystem/PlaceholderProviders/TimestampableElementProviderTest.php b/tests/Services/LabelSystem/PlaceholderProviders/TimestampableElementProviderTest.php index 8af988f7..a72f06df 100644 --- a/tests/Services/LabelSystem/PlaceholderProviders/TimestampableElementProviderTest.php +++ b/tests/Services/LabelSystem/PlaceholderProviders/TimestampableElementProviderTest.php @@ -75,7 +75,7 @@ class TimestampableElementProviderTest extends WebTestCase }; } - public function dataProvider(): \Iterator + public static function dataProvider(): \Iterator { \Locale::setDefault('en'); yield ['1/1/00, 12:00 AM', '[[LAST_MODIFIED]]']; diff --git a/tests/Services/LabelSystem/SandboxedTwigFactoryTest.php b/tests/Services/LabelSystem/SandboxedTwigFactoryTest.php index 26ba131e..32317435 100644 --- a/tests/Services/LabelSystem/SandboxedTwigFactoryTest.php +++ b/tests/Services/LabelSystem/SandboxedTwigFactoryTest.php @@ -62,7 +62,7 @@ class SandboxedTwigFactoryTest extends WebTestCase $this->service = self::getContainer()->get(SandboxedTwigFactory::class); } - public function twigDataProvider(): \Iterator + public static function twigDataProvider(): \Iterator { yield [' {% for i in range(1, 3) %} {{ part.id }} @@ -95,7 +95,7 @@ class SandboxedTwigFactoryTest extends WebTestCase ']; } - public function twigNotAllowedDataProvider(): \Iterator + public static function twigNotAllowedDataProvider(): \Iterator { yield ['{% block test %} {% endblock %}']; yield ['{% deprecated test %}']; diff --git a/tests/Services/Misc/FAIconGeneratorTest.php b/tests/Services/Misc/FAIconGeneratorTest.php index f5c30b72..1aec5d02 100644 --- a/tests/Services/Misc/FAIconGeneratorTest.php +++ b/tests/Services/Misc/FAIconGeneratorTest.php @@ -42,7 +42,7 @@ class FAIconGeneratorTest extends WebTestCase $this->service = self::getContainer()->get(FAIconGenerator::class); } - public function fileExtensionDataProvider(): \Iterator + public static function fileExtensionDataProvider(): \Iterator { yield ['pdf', 'fa-file-pdf']; yield ['jpeg','fa-file-image']; diff --git a/tests/Services/Misc/RangeParserTest.php b/tests/Services/Misc/RangeParserTest.php index 71c412cb..084ca80b 100644 --- a/tests/Services/Misc/RangeParserTest.php +++ b/tests/Services/Misc/RangeParserTest.php @@ -58,7 +58,7 @@ class RangeParserTest extends WebTestCase $this->service = self::getContainer()->get(RangeParser::class); } - public function dataProvider(): \Iterator + public static function dataProvider(): \Iterator { yield [[], '']; yield [[], ' ']; @@ -82,7 +82,7 @@ class RangeParserTest extends WebTestCase yield [[], '1, 2, test', true]; } - public function validDataProvider(): \Iterator + public static function validDataProvider(): \Iterator { yield [true, '']; yield [true, ' ']; diff --git a/tests/Services/Parameters/ParameterExtractorTest.php b/tests/Services/Parameters/ParameterExtractorTest.php index 8c6e7df1..d0b8fed0 100644 --- a/tests/Services/Parameters/ParameterExtractorTest.php +++ b/tests/Services/Parameters/ParameterExtractorTest.php @@ -57,7 +57,7 @@ class ParameterExtractorTest extends WebTestCase $this->service = self::getContainer()->get(ParameterExtractor::class); } - public function emptyDataProvider(): \Iterator + public static function emptyDataProvider(): \Iterator { yield ['']; yield [' ']; diff --git a/tests/Services/Parts/PricedetailHelperTest.php b/tests/Services/Parts/PricedetailHelperTest.php index b9c5e72b..5d9bd351 100644 --- a/tests/Services/Parts/PricedetailHelperTest.php +++ b/tests/Services/Parts/PricedetailHelperTest.php @@ -44,7 +44,7 @@ class PricedetailHelperTest extends WebTestCase $this->service = self::getContainer()->get(PricedetailHelper::class); } - public function maxDiscountAmountDataProvider(): ?\Generator + public static function maxDiscountAmountDataProvider(): ?\Generator { $part = new Part(); yield [$part, null, 'Part without any orderdetails failed!']; diff --git a/tests/Services/UserSystem/PermissionManagerTest.php b/tests/Services/UserSystem/PermissionManagerTest.php index 3082e3d8..478202f4 100644 --- a/tests/Services/UserSystem/PermissionManagerTest.php +++ b/tests/Services/UserSystem/PermissionManagerTest.php @@ -92,7 +92,7 @@ class PermissionManagerTest extends WebTestCase $this->group->method('getParent')->willReturn($parent_group); } - public function getPermissionNames(): \Iterator + public static function getPermissionNames(): \Iterator { //List some permission names yield ['parts']; diff --git a/tests/Services/UserSystem/TFA/BackupCodeGeneratorTest.php b/tests/Services/UserSystem/TFA/BackupCodeGeneratorTest.php index 83f39cae..2b6c22d1 100644 --- a/tests/Services/UserSystem/TFA/BackupCodeGeneratorTest.php +++ b/tests/Services/UserSystem/TFA/BackupCodeGeneratorTest.php @@ -47,7 +47,7 @@ class BackupCodeGeneratorTest extends TestCase new BackupCodeGenerator(4, 10); } - public function codeLengthDataProvider(): \Iterator + public static function codeLengthDataProvider(): \Iterator { yield [6]; yield [8]; @@ -62,7 +62,7 @@ class BackupCodeGeneratorTest extends TestCase $this->assertMatchesRegularExpression("/^([a-f0-9]){{$code_length}}\$/", $generator->generateSingleCode()); } - public function codeCountDataProvider(): \Iterator + public static function codeCountDataProvider(): \Iterator { yield [2]; yield [8]; diff --git a/tests/Twig/UserExtensionTest.php b/tests/Twig/UserExtensionTest.php index 21009f5e..235d39c1 100644 --- a/tests/Twig/UserExtensionTest.php +++ b/tests/Twig/UserExtensionTest.php @@ -37,7 +37,7 @@ class UserExtensionTest extends WebTestCase $this->service = self::getContainer()->get(UserExtension::class); } - public function removeLocaleFromPathDataSet(): ?\Generator + public static function removeLocaleFromPathDataSet(): ?\Generator { yield ['/', '/de/']; yield ['/test', '/de/test'];