From 1d1730ed6439cd842dc1b9615a4bb8e215aebe48 Mon Sep 17 00:00:00 2001 From: Richard Klees Date: Mon, 29 Apr 2024 16:19:41 +0200 Subject: [PATCH] PHPUnit: make all dataProviders static --- .../tests/ilWhiteListUrlValidatorTest.php | 2 +- .../Badge/tests/PresentationHeaderTest.php | 2 +- components/ILIAS/Badge/tests/SortingTest.php | 2 +- components/ILIAS/Badge/tests/TileTest.php | 2 +- components/ILIAS/Cache/tests/CacheTest.php | 2 +- ...teCourseLearningProgressEvaluationTest.php | 2 +- .../Certificate/tests/ilXlsFoParserTest.php | 2 +- .../class.ilChatroomServerSettingsTest.php | 2 +- .../tests/class.ilChatroomUserTest.php | 2 +- .../Component/tests/Dependencies/NameTest.php | 2 +- .../tests/Dependencies/RendererTest.php | 2 +- .../Settings/ilPluginsOverviewTableTest.php | 2 +- .../Component/tests/ilPluginInfoTest.php | 8 +- .../ilBuddySystemRelationCollectionTest.php | 2 +- .../ContentPage/tests/PageReadingTimeTest.php | 2 +- .../ILIAS/Context/tests/ilContextTest.php | 2 +- .../ILIAS/Cron/tests/CronJobScheduleTest.php | 118 +++++++++--------- components/ILIAS/Data/tests/ClientIdTest.php | 4 +- components/ILIAS/Data/tests/DataSizeTest.php | 4 +- .../ILIAS/Data/tests/LanguageTagTest.php | 4 +- components/ILIAS/Data/tests/RangeTest.php | 2 +- components/ILIAS/Data/tests/URITest.php | 2 +- components/ILIAS/Data/tests/VersionTest.php | 4 +- .../FileDelivery/tests/Token/TokenTest.php | 2 +- .../tests/Processor/SVGPreProcessorTest.php | 4 +- .../Util/Convert/ImageConversionTest.php | 10 +- .../Convert/LegacyImageConversionTest.php | 2 +- .../tests/Util/FilenameSanitizing.php | 2 +- .../ILIAS/Filesystem/tests/Util/UnzipTest.php | 28 ++--- .../ILIAS/Filesystem/tests/Util/ZipTest.php | 24 ++-- .../tests/ForumNotificationCacheTest.php | 4 +- .../tests/Toast/StandardToastTest.php | 2 +- .../tests/ilHtmlPurifierCompositeTest.php | 2 +- .../tests/ilHtmlPurifierLibWrapperTest.php | 2 +- .../ilIndividualAssessmentMemberTest.php | 6 +- ...dividualAssessmentMembersStorageDBTest.php | 2 +- .../tests/AdministrationEditLinksTest.php | 2 +- .../LegalDocuments/tests/ConductorTest.php | 2 +- .../tests/ConsumerToolbox/UserTest.php | 2 +- .../LegalDocuments/tests/HTMLPurifierTest.php | 2 +- .../LegalDocuments/tests/LazyProvideTest.php | 2 +- .../LegalDocuments/tests/ValidHTMLTest.php | 2 +- .../Mail/tests/ilMailAddressListTest.php | 4 +- .../Mail/tests/ilMailAddressParserTest.php | 4 +- .../tests/ilMailAutoresponderServiceTest.php | 2 +- .../Mail/tests/ilMailBodyPurifierTest.php | 2 +- .../Mail/tests/ilMailErrorFormatterTest.php | 2 +- .../tests/ilMailMimeSubjectBuilderTest.php | 4 +- .../ILIAS/Mail/tests/ilMailOptionsTest.php | 2 +- components/ILIAS/Mail/tests/ilMailTest.php | 2 +- components/ILIAS/Maps/tests/ilMapGUITest.php | 2 +- .../Math/tests/ilMathBaseAdapterTest.php | 2 +- components/ILIAS/Math/tests/ilMathTest.php | 2 +- .../MathJax/tests/class.ilMathJaxTest.php | 4 +- .../encoders/ilBcryptPasswordEncoderTest.php | 2 +- .../ilBcryptPhpPasswordEncoderTest.php | 2 +- .../QTI/tests/ilQTIAssessmentcontrolTest.php | 4 +- .../ILIAS/QTI/tests/ilQTIDecvarTest.php | 2 +- .../ILIAS/QTI/tests/ilQTIItemfeedbackTest.php | 2 +- .../ILIAS/QTI/tests/ilQTIMattextTest.php | 2 +- .../ILIAS/QTI/tests/ilQTIRenderFibTest.php | 4 +- .../QTI/tests/ilQTIRespconditionTest.php | 2 +- .../QTI/tests/ilQTIResponseLabelTest.php | 6 +- .../ILIAS/QTI/tests/ilQTIResponseTest.php | 4 +- .../ILIAS/QTI/tests/ilQTIResponseVarTest.php | 6 +- .../ILIAS/QTI/tests/ilQTISetvarTest.php | 2 +- .../Randomization/tests/ilRandomTest.php | 2 +- .../tests/ByTrying/ByTryingTransformTest.php | 6 +- .../BooleanTransformationTest.php | 4 +- .../DateTimeTransformationTest.php | 4 +- .../DictionaryTransformationTest.php | 4 +- .../FloatTransformationTest.php | 4 +- .../IntegerTransformationTest.php | 4 +- .../Transformation/ListTransformationTest.php | 4 +- .../Transformation/NullTransformationTest.php | 2 +- .../RecordTransformationTest.php | 6 +- .../StringTransformationTest.php | 2 +- .../TupleTransformationTest.php | 6 +- .../Logical/Constraint/LogicalOrTest.php | 14 ++- .../Refinery/tests/Parser/ABNF/BrickTest.php | 24 ++-- .../Constraint/PasswordContraintsTest.php | 12 +- .../tests/String/Encoding/EncodingTest.php | 4 +- .../tests/String/EstimatedReadingTimeTest.php | 4 +- .../tests/String/MakeClickableTest.php | 10 +- .../String/MarkdownFormattingToHTMLTest.php | 2 +- .../Refinery/tests/String/UTFNormalTest.php | 2 +- .../InArrayTransformationTest.php | 2 +- .../tests/Flavours/FlavourMachineTest.php | 4 +- .../ILIAS/Setup/tests/Metrics/MetricTest.php | 4 +- .../StaticURL/tests/LegacyGotoHandlerTest.php | 2 +- .../ILIAS/StaticURL/tests/URIBuilderTest.php | 4 +- .../ilStudyProgrammeProgressTest.php | 10 +- .../ilSystemStyleExceptionBaseUnit.php | 2 +- .../tests/AccessFileUploadPreviewTest.php | 12 +- .../Test/tests/AccessQuestionImageTest.php | 4 +- .../ilTestEvaluationExceptionTest.php | 6 +- .../tests/Exceptions/ilTestExceptionTest.php | 6 +- ...ngQuestionPoolIdParameterExceptionTest.php | 6 +- ...cePoolDefinitionParameterExceptionTest.php | 6 +- ...NextRequestableHintExistsExceptionTest.php | 6 +- ...lNotAvailableAsSourcePoolExceptionTest.php | 7 +- .../ilObjTestMainSettingsTest.php | 20 +-- .../ilObjTestSettingsAccessTest.php | 16 +-- .../ilObjTestSettingsAdditionalTest.php | 6 +- .../ilObjTestSettingsFinishingTest.php | 16 +-- .../ilObjTestSettingsGeneralTest.php | 6 +- .../ilObjTestSettingsIntroductionTest.php | 10 +- ...stSettingsParticipantFunctionalityTest.php | 14 +-- ...ilObjTestSettingsQuestionBehaviourTest.php | 28 ++--- .../ilObjTestSettingsTestBehaviourTest.php | 16 +-- .../tests/Results/ilTestPassResultTest.php | 10 +- .../ilObjTestSettingsGamificationTest.php | 22 ++-- .../ilObjTestSettingsResultDetailsTest.php | 22 ++-- .../ilObjTestSettingsResultSummaryTest.php | 16 +-- .../ilObjTestSettingsScoringTest.php | 8 +- .../ILIAS/Test/tests/ilObjTestListGUITest.php | 4 +- components/ILIAS/Test/tests/ilTestLPTest.php | 4 +- ...ilTestQuestionPoolSelectorExplorerTest.php | 5 +- .../ILIAS/Test/tests/ilTestServiceGUITest.php | 4 +- .../tests/assFormulaQuestionTest.php | 2 +- ...AssQuestionSkillAssignmentRegistryTest.php | 2 +- .../ILIAS/UI/tests/AbstractFactoryTest.php | 2 +- .../UI/tests/Component/Button/ButtonTest.php | 2 +- .../tests/Component/Counter/CounterTest.php | 6 +- .../UI/tests/Component/Entity/EntityTest.php | 2 +- .../Component/MessageBox/MessageBoxTest.php | 2 +- .../UI/tests/Component/Modal/LightboxTest.php | 2 +- .../Component/Symbol/Glyph/GlyphTest.php | 4 +- .../Table/Column/ColumnFactoryTest.php | 2 +- .../UI/tests/Component/Toast/ToastTest.php | 2 +- .../ILIAS/UI/tests/Examples/ExamplesTest.php | 4 +- .../UI/tests/Renderer/DefaultRendererTest.php | 2 +- .../tests/Structure/ilCtrlStructureTest.php | 2 +- .../ILIAS/Utilities/tests/ilUtilTest.php | 6 +- 134 files changed, 418 insertions(+), 400 deletions(-) diff --git a/components/ILIAS/AuthApache/tests/ilWhiteListUrlValidatorTest.php b/components/ILIAS/AuthApache/tests/ilWhiteListUrlValidatorTest.php index c0b0c9e63f36..dbb2dcc2c14c 100755 --- a/components/ILIAS/AuthApache/tests/ilWhiteListUrlValidatorTest.php +++ b/components/ILIAS/AuthApache/tests/ilWhiteListUrlValidatorTest.php @@ -24,7 +24,7 @@ */ final class ilWhiteListUrlValidatorTest extends TestCase { - public function domainProvider(): array + public static function domainProvider(): array { return [ 'Empty String / Empty Whitelist' => ['', [], false], diff --git a/components/ILIAS/Badge/tests/PresentationHeaderTest.php b/components/ILIAS/Badge/tests/PresentationHeaderTest.php index 28d5f48f6a4c..6b45815abbd0 100755 --- a/components/ILIAS/Badge/tests/PresentationHeaderTest.php +++ b/components/ILIAS/Badge/tests/PresentationHeaderTest.php @@ -88,7 +88,7 @@ public function testShow(bool $additional = false): void $head->show('tile_view', ...($additional_component[0] ?? [])); } - public function showProvider(): array + public static function showProvider(): array { return [ 'Without additional component' => [], diff --git a/components/ILIAS/Badge/tests/SortingTest.php b/components/ILIAS/Badge/tests/SortingTest.php index ba940730388c..af591ec8edfb 100755 --- a/components/ILIAS/Badge/tests/SortingTest.php +++ b/components/ILIAS/Badge/tests/SortingTest.php @@ -62,7 +62,7 @@ public function testOptions(): void ], array_keys((new Sorting())->options())); } - public function sortProvider(): array + public static function sortProvider(): array { return [ 'Default sort is title_asc' => [[], 'title_asc', 'sort_by_title_asc', 'badge', 'getTitle', ['A', 'a'], ['f', 'G'], ['d', 'c']], diff --git a/components/ILIAS/Badge/tests/TileTest.php b/components/ILIAS/Badge/tests/TileTest.php index 15ca83491d3d..9cab741124e6 100755 --- a/components/ILIAS/Badge/tests/TileTest.php +++ b/components/ILIAS/Badge/tests/TileTest.php @@ -190,7 +190,7 @@ public function testAs(string $method, array $expected_components): void array_map($this->assertInstanceOf(...), $expected_components, $components); } - public function provideAsVariants(): array + public static function provideAsVariants(): array { return [ 'Test asImage.' => ['asImage', [ModalComponent::class, ImageComponent::class]], diff --git a/components/ILIAS/Cache/tests/CacheTest.php b/components/ILIAS/Cache/tests/CacheTest.php index 983f3a4ac211..1d276693239c 100755 --- a/components/ILIAS/Cache/tests/CacheTest.php +++ b/components/ILIAS/Cache/tests/CacheTest.php @@ -171,7 +171,7 @@ public function testLock(): void $this->assertFalse($container->isLocked()); } - private function getInvalidLockTimes(): array + private static function getInvalidLockTimes(): array { return [ [-10], diff --git a/components/ILIAS/Certificate/tests/ilCertificateCourseLearningProgressEvaluationTest.php b/components/ILIAS/Certificate/tests/ilCertificateCourseLearningProgressEvaluationTest.php index 7cd59a8ab61d..8454958c92e3 100755 --- a/components/ILIAS/Certificate/tests/ilCertificateCourseLearningProgressEvaluationTest.php +++ b/components/ILIAS/Certificate/tests/ilCertificateCourseLearningProgressEvaluationTest.php @@ -298,7 +298,7 @@ public function testNoSubitemDefinedForEvaluation(): void $this->assertSame([], $completedCourses); } - public function globalLearningProgressStateProvder(): array + public static function globalLearningProgressStateProvder(): array { return [ 'LP globally enabled' => [true, []], diff --git a/components/ILIAS/Certificate/tests/ilXlsFoParserTest.php b/components/ILIAS/Certificate/tests/ilXlsFoParserTest.php index efb0d43555af..e9481c5c13e7 100755 --- a/components/ILIAS/Certificate/tests/ilXlsFoParserTest.php +++ b/components/ILIAS/Certificate/tests/ilXlsFoParserTest.php @@ -433,7 +433,7 @@ public function testCommasWillBeConvertedToPointInDecimalSepartor(): void $this->assertSame('Something Processed', $output); } - public function nonBreakingSpaceIsAddedDataProvider(): Generator + public static function nonBreakingSpaceIsAddedDataProvider(): Generator { $expected_fo_with_centered_block = << diff --git a/components/ILIAS/Chatroom/tests/class.ilChatroomServerSettingsTest.php b/components/ILIAS/Chatroom/tests/class.ilChatroomServerSettingsTest.php index 3d6dfd5269c6..f229b478a086 100755 --- a/components/ILIAS/Chatroom/tests/class.ilChatroomServerSettingsTest.php +++ b/components/ILIAS/Chatroom/tests/class.ilChatroomServerSettingsTest.php @@ -28,7 +28,7 @@ class ilChatroomServerSettingsTest extends TestCase { protected ilChatroomServerSettings $settings; - public function setterAndGettersProvider(): array + public static function setterAndGettersProvider(): array { $assertIsString = function ($actual): void { $this->assertIsString($actual, 'The actual return value is not a type of "string"'); diff --git a/components/ILIAS/Chatroom/tests/class.ilChatroomUserTest.php b/components/ILIAS/Chatroom/tests/class.ilChatroomUserTest.php index 70a2bf4a6e6c..a9e443a3ed41 100755 --- a/components/ILIAS/Chatroom/tests/class.ilChatroomUserTest.php +++ b/components/ILIAS/Chatroom/tests/class.ilChatroomUserTest.php @@ -178,7 +178,7 @@ public function testGetChatNameSuggestionsIfNotAnonymous(): void $this->assertSame('jdoe', $suggestions['login']); } - public function usernameDataProvider(): array + public static function usernameDataProvider(): array { return [ ['username', 'username'], diff --git a/components/ILIAS/Component/tests/Dependencies/NameTest.php b/components/ILIAS/Component/tests/Dependencies/NameTest.php index a53970460c2e..89269ba53b89 100644 --- a/components/ILIAS/Component/tests/Dependencies/NameTest.php +++ b/components/ILIAS/Component/tests/Dependencies/NameTest.php @@ -43,7 +43,7 @@ public function testImproperNames(string $name): void $n = new Name($name); } - public function properNames(): array + public static function properNames(): array { return [ [\ILIAS\Component\Tests::class], diff --git a/components/ILIAS/Component/tests/Dependencies/RendererTest.php b/components/ILIAS/Component/tests/Dependencies/RendererTest.php index e9d95652ac19..138a22ca9f61 100644 --- a/components/ILIAS/Component/tests/Dependencies/RendererTest.php +++ b/components/ILIAS/Component/tests/Dependencies/RendererTest.php @@ -55,7 +55,7 @@ public function testScenario($scenario_file, $result_file, $components) $this->assertEquals($expected, $result); } - public function scenarios() + public static function scenarios() { return [ "no dependencies" => ["scenario1.php", "result1.php", diff --git a/components/ILIAS/Component/tests/Settings/ilPluginsOverviewTableTest.php b/components/ILIAS/Component/tests/Settings/ilPluginsOverviewTableTest.php index c19e8ed119e0..b7d37b9dc78a 100755 --- a/components/ILIAS/Component/tests/Settings/ilPluginsOverviewTableTest.php +++ b/components/ILIAS/Component/tests/Settings/ilPluginsOverviewTableTest.php @@ -51,7 +51,7 @@ public function testCreateObject(): void $this->assertInstanceOf(ilPluginsOverviewTable::class, $obj); } - public function getImportantFieldData(): array + public static function getImportantFieldData(): array { return [ [true, true], diff --git a/components/ILIAS/Component/tests/ilPluginInfoTest.php b/components/ILIAS/Component/tests/ilPluginInfoTest.php index 259ac19f193f..a5aa3e07c572 100755 --- a/components/ILIAS/Component/tests/ilPluginInfoTest.php +++ b/components/ILIAS/Component/tests/ilPluginInfoTest.php @@ -232,7 +232,7 @@ public function testIsCompliantToILIAS(Data\Version $version, bool $is_compliant $this->assertSame($is_compliant, $plugin->isCompliantToILIAS()); } - public function versionCompliance(): array + public static function versionCompliance(): array { $data_factory = new Data\Factory(); return [ @@ -318,7 +318,7 @@ public function isVersionToOld(): bool $this->assertEquals($is_activation_possible, $plugin->isActivationPossible()); } - public function isActivationPossibleTruthTable(): array + public static function isActivationPossibleTruthTable(): array { // is_installed, supports_current_ilias, needs_update, is_version_to_old => is_activation_possible return [ @@ -402,7 +402,7 @@ public function isVersionToOld(): bool $this->assertEquals($is_activation_possible, $plugin->isActive()); } - public function isActiveTruthTable(): array + public static function isActiveTruthTable(): array { // is_installed, supports_current_ilias, needs_update, is_activated, is_version_to_old => is_active return [ @@ -527,7 +527,7 @@ public function isActive(): bool $plugin->getReasonForInactivity(); } - public function inactivityReasonTable(): array + public static function inactivityReasonTable(): array { // is_installed, supports_current_ilias, needs_update, is_activated, is_version_to_old => inactivity_reason return [ diff --git a/components/ILIAS/Contact/BuddySystem/test/ilBuddySystemRelationCollectionTest.php b/components/ILIAS/Contact/BuddySystem/test/ilBuddySystemRelationCollectionTest.php index 35410879375f..358937426c76 100755 --- a/components/ILIAS/Contact/BuddySystem/test/ilBuddySystemRelationCollectionTest.php +++ b/components/ILIAS/Contact/BuddySystem/test/ilBuddySystemRelationCollectionTest.php @@ -149,7 +149,7 @@ public function testElementsCanBeFiltered(): void /** * @return array{indexed: int[][], associative: array, mixed: array>, relations: \ilBuddySystemRelation&\PHPUnit\Framework\MockObject\MockObject[][]} */ - public function provideElements(): array + public static function provideElements(): array { $relation1 = $this->getMockBuilder(ilBuddySystemRelation::class)->disableOriginalConstructor()->getMock(); $relation2 = $this->getMockBuilder(ilBuddySystemRelation::class)->disableOriginalConstructor()->getMock(); diff --git a/components/ILIAS/ContentPage/tests/PageReadingTimeTest.php b/components/ILIAS/ContentPage/tests/PageReadingTimeTest.php index 7fe5fe6b4608..6638e06c028b 100755 --- a/components/ILIAS/ContentPage/tests/PageReadingTimeTest.php +++ b/components/ILIAS/ContentPage/tests/PageReadingTimeTest.php @@ -31,7 +31,7 @@ */ class PageReadingTimeTest extends TestCase { - public function mixedReadingTypesProvider(): array + public static function mixedReadingTypesProvider(): array { return [ 'Float Type' => [4.0], diff --git a/components/ILIAS/Context/tests/ilContextTest.php b/components/ILIAS/Context/tests/ilContextTest.php index a4105d8ab1bd..c48f73a797fb 100755 --- a/components/ILIAS/Context/tests/ilContextTest.php +++ b/components/ILIAS/Context/tests/ilContextTest.php @@ -26,7 +26,7 @@ public function testInit(string $context, string $className): void $this->assertEquals(ilContextExtended::getClassName(), $className); } - public function contextProvider(): array + public static function contextProvider(): array { return [ [ilContext::CONTEXT_WEB, ilContextWeb::class], diff --git a/components/ILIAS/Cron/tests/CronJobScheduleTest.php b/components/ILIAS/Cron/tests/CronJobScheduleTest.php index 42e7e314d543..0590457b71af 100755 --- a/components/ILIAS/Cron/tests/CronJobScheduleTest.php +++ b/components/ILIAS/Cron/tests/CronJobScheduleTest.php @@ -27,11 +27,11 @@ */ class CronJobScheduleTest extends TestCase { - private DateTimeImmutable $now; + private static DateTimeImmutable $now; - private DateTimeImmutable $this_quarter_start; + private static DateTimeImmutable $this_quarter_start; - private function getJob( + private static function getJob( bool $has_flexible_schedule, CronJobScheduleType $default_schedule_type, ?int $default_schedule_value, @@ -92,23 +92,23 @@ public function run(): ilCronJobResult }; $job_instance->setDateTimeProvider(function (): DateTimeImmutable { - return $this->now; + return self::now; }); return $job_instance; } - public function jobProvider(): array + public static function jobProvider(): array { // Can't be moved to setUp(), because the data provider is executed before the tests are executed - $this->now = new DateTimeImmutable('@' . time()); + self::$now = new DateTimeImmutable('@' . time()); - $offset = (((int) $this->now->format('n')) - 1) % 3; - $this->this_quarter_start = $this->now->modify("first day of -$offset month midnight"); + $offset = (((int) self::$now->format('n')) - 1) % 3; + self::$this_quarter_start = self::$now->modify("first day of -$offset month midnight"); return [ 'Manual Run is Always Due' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null), true, null, CronJobScheduleType::SCHEDULE_TYPE_DAILY, @@ -116,7 +116,7 @@ public function jobProvider(): array true ], 'Job Without Any Run is Always Due' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null), false, null, CronJobScheduleType::SCHEDULE_TYPE_DAILY, @@ -124,129 +124,129 @@ public function jobProvider(): array true ], 'Daily Schedule / Did not run Today' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null), false, - $this->now->modify('-1 day'), + self::$now->modify('-1 day'), CronJobScheduleType::SCHEDULE_TYPE_DAILY, null, true ], 'Daily Schedule / Did run Today' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null), false, - $this->now, + self::$now, CronJobScheduleType::SCHEDULE_TYPE_DAILY, null, false ], 'Weekly Schedule / Did not run this Week' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), false, - $this->now->modify('-1 week'), + self::$now->modify('-1 week'), CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, true ], 'Weekly Schedule / Did run this Week' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), false, - $this->now->modify('monday this week'), + self::$now->modify('monday this week'), CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, false ], 'Monthly Schedule / Did not run this Month' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_MONTHLY, null, CronJobScheduleType::SCHEDULE_TYPE_MONTHLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_MONTHLY, null, CronJobScheduleType::SCHEDULE_TYPE_MONTHLY, null), false, - $this->now->modify('last day of last month'), + self::$now->modify('last day of last month'), CronJobScheduleType::SCHEDULE_TYPE_MONTHLY, null, true ], 'Monthly Schedule / Did run this Month' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_MONTHLY, null, CronJobScheduleType::SCHEDULE_TYPE_MONTHLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_MONTHLY, null, CronJobScheduleType::SCHEDULE_TYPE_MONTHLY, null), false, - $this->now->modify('first day of this month'), + self::$now->modify('first day of this month'), CronJobScheduleType::SCHEDULE_TYPE_MONTHLY, null, false ], 'Yearly Schedule / Did not run this Year' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_YEARLY, null, CronJobScheduleType::SCHEDULE_TYPE_YEARLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_YEARLY, null, CronJobScheduleType::SCHEDULE_TYPE_YEARLY, null), false, - $this->now->modify('-1 year'), + self::$now->modify('-1 year'), CronJobScheduleType::SCHEDULE_TYPE_YEARLY, null, true ], 'Yearly Schedule / Did run this Year' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_YEARLY, null, CronJobScheduleType::SCHEDULE_TYPE_YEARLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_YEARLY, null, CronJobScheduleType::SCHEDULE_TYPE_YEARLY, null), false, - $this->now->modify('first day of January this year'), + self::$now->modify('first day of January this year'), CronJobScheduleType::SCHEDULE_TYPE_YEARLY, null, false ], 'Quarterly Schedule / Did not run this Quarter' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_QUARTERLY, null, CronJobScheduleType::SCHEDULE_TYPE_QUARTERLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_QUARTERLY, null, CronJobScheduleType::SCHEDULE_TYPE_QUARTERLY, null), false, - $this->this_quarter_start->modify('-1 seconds'), + self::$this_quarter_start->modify('-1 seconds'), CronJobScheduleType::SCHEDULE_TYPE_QUARTERLY, null, true ], 'Quarterly Schedule / Did run this Quarter' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_QUARTERLY, null, CronJobScheduleType::SCHEDULE_TYPE_QUARTERLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_QUARTERLY, null, CronJobScheduleType::SCHEDULE_TYPE_QUARTERLY, null), false, - $this->this_quarter_start->modify('+30 seconds'), + self::$this_quarter_start->modify('+30 seconds'), CronJobScheduleType::SCHEDULE_TYPE_QUARTERLY, null, false ], 'Minutely Schedule / Did not run this Minute' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_IN_MINUTES, 1, CronJobScheduleType::SCHEDULE_TYPE_IN_MINUTES, 1), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_IN_MINUTES, 1, CronJobScheduleType::SCHEDULE_TYPE_IN_MINUTES, 1), false, - $this->now->modify('-1 minute'), + self::$now->modify('-1 minute'), CronJobScheduleType::SCHEDULE_TYPE_IN_MINUTES, 1, true ], 'Minutely Schedule / Did run this Minute' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_IN_MINUTES, 1, CronJobScheduleType::SCHEDULE_TYPE_IN_MINUTES, 1), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_IN_MINUTES, 1, CronJobScheduleType::SCHEDULE_TYPE_IN_MINUTES, 1), false, - $this->now->modify('-30 seconds'), + self::$now->modify('-30 seconds'), CronJobScheduleType::SCHEDULE_TYPE_IN_MINUTES, 1, false ], 'Hourly Schedule / Did not run this Hour' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_IN_HOURS, 7, CronJobScheduleType::SCHEDULE_TYPE_IN_HOURS, 7), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_IN_HOURS, 7, CronJobScheduleType::SCHEDULE_TYPE_IN_HOURS, 7), false, - $this->now->modify('-7 hours'), + self::$now->modify('-7 hours'), CronJobScheduleType::SCHEDULE_TYPE_IN_HOURS, 7, true ], 'Hourly Schedule / Did run this Hour' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_IN_HOURS, 7, CronJobScheduleType::SCHEDULE_TYPE_IN_HOURS, 7), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_IN_HOURS, 7, CronJobScheduleType::SCHEDULE_TYPE_IN_HOURS, 7), false, - $this->now->modify('-7 hours +30 seconds'), + self::$now->modify('-7 hours +30 seconds'), CronJobScheduleType::SCHEDULE_TYPE_IN_HOURS, 7, false ], 'Every 5 Days Schedule / Did not run for 5 Days' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_IN_DAYS, 5, CronJobScheduleType::SCHEDULE_TYPE_IN_DAYS, 5), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_IN_DAYS, 5, CronJobScheduleType::SCHEDULE_TYPE_IN_DAYS, 5), false, - $this->now->modify('-5 days'), + self::$now->modify('-5 days'), CronJobScheduleType::SCHEDULE_TYPE_IN_DAYS, 5, true ], 'Every 5 Days Schedule / Did run withing the last 5 Days' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_IN_DAYS, 5, CronJobScheduleType::SCHEDULE_TYPE_IN_DAYS, 5), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_IN_DAYS, 5, CronJobScheduleType::SCHEDULE_TYPE_IN_DAYS, 5), false, - $this->now->modify('-4 days'), + self::$now->modify('-4 days'), CronJobScheduleType::SCHEDULE_TYPE_IN_DAYS, 5, false @@ -272,22 +272,22 @@ public function testSchedule( ); } - public function weeklyScheduleProvider(): Generator + public static function weeklyScheduleProvider(): Generator { yield 'Different Week' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), function (): DateTimeImmutable { - $this->now = new DateTimeImmutable('@1672570104'); // Sun Jan 01 2023 10:48:24 GMT+0000 (year: 2023 / week: 52) + self::$now = new DateTimeImmutable('@1672570104'); // Sun Jan 01 2023 10:48:24 GMT+0000 (year: 2023 / week: 52) - return $this->now->modify('-1 week'); // Sun Dec 25 2022 10:48:24 GMT+0000 (year: 2022 / week: 51) + return self::$now->modify('-1 week'); // Sun Dec 25 2022 10:48:24 GMT+0000 (year: 2022 / week: 51) }, true ]; yield 'Same Week and Year, but different Month: December (now) and January (Last run)' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), function (): DateTimeImmutable { - $this->now = new DateTimeImmutable('@1703669703'); // Wed Dec 27 2023 09:35:03 GMT+0000 (year: 2023 / week: 52 / month: 12) + self::$now = new DateTimeImmutable('@1703669703'); // Wed Dec 27 2023 09:35:03 GMT+0000 (year: 2023 / week: 52 / month: 12) return new DateTimeImmutable('@1672570104'); // Sun Jan 01 2023 10:48:24 GMT+0000 (year: 2023 / week: 52 / month: 1) }, @@ -295,39 +295,39 @@ function (): DateTimeImmutable { ]; yield 'Same Week and Year and same Month: January' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), function (): DateTimeImmutable { - $this->now = new DateTimeImmutable('@1704188103'); // Tue Jan 02 2024 09:35:03 GMT+0000 (year: 2024 / week: 1 / month: 1) + self::$now = new DateTimeImmutable('@1704188103'); // Tue Jan 02 2024 09:35:03 GMT+0000 (year: 2024 / week: 1 / month: 1) - return $this->now->modify('-1 day'); // Mon Jan 01 2024 09:35:03 GMT+0000 (year: 2024 / week: 1 / month: 1) + return self::$now->modify('-1 day'); // Mon Jan 01 2024 09:35:03 GMT+0000 (year: 2024 / week: 1 / month: 1) }, false ]; yield 'Same Week (52nd), but Year Difference > 1' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), function (): DateTimeImmutable { - $this->now = new DateTimeImmutable('@1672570104'); // Sun Jan 01 2023 10:48:24 GMT+0000 (year: 2023 / week: 52) + self::$now = new DateTimeImmutable('@1672570104'); // Sun Jan 01 2023 10:48:24 GMT+0000 (year: 2023 / week: 52) - return $this->now->modify('tuesday this week')->modify('-1 year'); // Mon Dec 27 2021 10:48:24 GMT+0000 (year: 2021 / week: 52) + return self::$now->modify('tuesday this week')->modify('-1 year'); // Mon Dec 27 2021 10:48:24 GMT+0000 (year: 2021 / week: 52) }, true ]; yield 'Same Week (52nd) in different Years, but Turn of the Year' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), function (): DateTimeImmutable { - $this->now = new DateTimeImmutable('@1672570104'); // Sun Jan 01 2023 10:48:24 GMT+0000 (year: 2023 / week: 52 / month: 1) + self::$now = new DateTimeImmutable('@1672570104'); // Sun Jan 01 2023 10:48:24 GMT+0000 (year: 2023 / week: 52 / month: 1) - return $this->now->modify('monday this week'); // Mon Dec 26 2022 10:48:24 GMT+0000 (year: 2022 / week: 52 / month: 12) + return self::$now->modify('monday this week'); // Mon Dec 26 2022 10:48:24 GMT+0000 (year: 2022 / week: 52 / month: 12) }, false ]; yield 'Same Week (52nd) in different Years, but not Turn of the Year' => [ - $this->getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), + self::getJob(true, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null, CronJobScheduleType::SCHEDULE_TYPE_WEEKLY, null), function (): DateTimeImmutable { - $this->now = new DateTimeImmutable('@1703669703'); // Wed Dec 27 2023 09:35:03 GMT+0000 (year: 2023 / week: 52 / month: 12) + self::$now = new DateTimeImmutable('@1703669703'); // Wed Dec 27 2023 09:35:03 GMT+0000 (year: 2023 / week: 52 / month: 12) return new DateTimeImmutable('@1672012800'); // Mon Dec 26 2022 00:00:00 GMT+0000 (year: 2022 / week: 52 / month: 12) }, diff --git a/components/ILIAS/Data/tests/ClientIdTest.php b/components/ILIAS/Data/tests/ClientIdTest.php index f727cfbe9dcc..e553a11dd200 100755 --- a/components/ILIAS/Data/tests/ClientIdTest.php +++ b/components/ILIAS/Data/tests/ClientIdTest.php @@ -28,7 +28,7 @@ protected function setUp(): void /** * @return array[] */ - public function clientIdProvider(): array + public static function clientIdProvider(): array { return [ 'single letter' => ['c'], @@ -47,7 +47,7 @@ public function clientIdProvider(): array /** * @return array[] */ - public function invalidClientIdProvider(): array + public static function invalidClientIdProvider(): array { return [ 'path traversal' => ['../../../../some/obscure/path'], diff --git a/components/ILIAS/Data/tests/DataSizeTest.php b/components/ILIAS/Data/tests/DataSizeTest.php index 45c819672a6a..aa57eebef746 100755 --- a/components/ILIAS/Data/tests/DataSizeTest.php +++ b/components/ILIAS/Data/tests/DataSizeTest.php @@ -30,7 +30,7 @@ */ class DataSizeTest extends TestCase { - public function provideDataSizes(): array + public static function provideDataSizes(): array { return [ [1000, '1000 B'], @@ -82,7 +82,7 @@ public function test_division_by_zero(): void } } - public function tDataProvider(): array + public static function tDataProvider(): array { return [ [122, 1000, "122 B", 122], diff --git a/components/ILIAS/Data/tests/LanguageTagTest.php b/components/ILIAS/Data/tests/LanguageTagTest.php index 37868d353071..78b2b5841f4f 100755 --- a/components/ILIAS/Data/tests/LanguageTagTest.php +++ b/components/ILIAS/Data/tests/LanguageTagTest.php @@ -52,7 +52,7 @@ public function testRisky(string $input, bool $isOk): void $this->testParse($input, $isOk); } - public function saveToRun(): array + public static function saveToRun(): array { return [ ['de', true], @@ -139,7 +139,7 @@ public function saveToRun(): array ]; } - public function risky(): array + public static function risky(): array { if (function_exists('xdebug_info') && ((int) ini_get('xdebug.max_nesting_level')) < 780) { $this->markTestSkipped(sprintf( diff --git a/components/ILIAS/Data/tests/RangeTest.php b/components/ILIAS/Data/tests/RangeTest.php index fc2eb6bf0726..7f918eb50957 100755 --- a/components/ILIAS/Data/tests/RangeTest.php +++ b/components/ILIAS/Data/tests/RangeTest.php @@ -119,7 +119,7 @@ public function testCroppedTo($start, $length, $max, $has_changed): void } } - public function cropCases(): array + public static function cropCases(): array { return [ [0, 100, 1000, false], diff --git a/components/ILIAS/Data/tests/URITest.php b/components/ILIAS/Data/tests/URITest.php index ed14f2ce62a1..c5889e057086 100755 --- a/components/ILIAS/Data/tests/URITest.php +++ b/components/ILIAS/Data/tests/URITest.php @@ -106,7 +106,7 @@ public function testIPv6(string $host): void $this->assertEquals(null, $uri->getFragment()); } - public function provideIPv6addresses(): array + public static function provideIPv6addresses(): array { return [ // Long form. diff --git a/components/ILIAS/Data/tests/VersionTest.php b/components/ILIAS/Data/tests/VersionTest.php index 67678d2f3ffc..3b2afa4c9148 100755 --- a/components/ILIAS/Data/tests/VersionTest.php +++ b/components/ILIAS/Data/tests/VersionTest.php @@ -77,7 +77,7 @@ public function testGreaterThan(Data\Version $l, Data\Version $r): void $this->assertFalse($r->equals($l)); } - public function greaterThanProvider(): array + public static function greaterThanProvider(): array { $f = new Data\Factory(); return [ @@ -106,7 +106,7 @@ public function testEquals(Data\Version $l, Data\Version $r): void $this->assertTrue($r->equals($l)); } - public function equalsProvider(): array + public static function equalsProvider(): array { $f = new Data\Factory(); return [ diff --git a/components/ILIAS/FileDelivery/tests/Token/TokenTest.php b/components/ILIAS/FileDelivery/tests/Token/TokenTest.php index 498992c4a27a..026ab8cb183c 100755 --- a/components/ILIAS/FileDelivery/tests/Token/TokenTest.php +++ b/components/ILIAS/FileDelivery/tests/Token/TokenTest.php @@ -60,7 +60,7 @@ public function testSomething(): void $this->assertSame($payload_data, $retrieve); } - public function providePayloads(): array + public static function providePayloads(): array { $random = static function (int $chars): string { for ($i = 0, $str = ''; $i < $chars; $i++) { diff --git a/components/ILIAS/FileUpload/tests/Processor/SVGPreProcessorTest.php b/components/ILIAS/FileUpload/tests/Processor/SVGPreProcessorTest.php index da6085f3d573..49eb66cf39da 100755 --- a/components/ILIAS/FileUpload/tests/Processor/SVGPreProcessorTest.php +++ b/components/ILIAS/FileUpload/tests/Processor/SVGPreProcessorTest.php @@ -43,7 +43,7 @@ protected function getPreProcessor(): SVGBlacklistPreProcessor ); } - public function maliciousSVGProvider(): array + public static function maliciousSVGProvider(): array { return [ [ @@ -121,7 +121,7 @@ public function testSaneSVG(): void $this->assertSame('SVG OK', $result->getMessage()); } - private function provideSomeComplexSaneSVG(): array + private static function provideSomeComplexSaneSVG(): array { return [ [__DIR__ . '/../../../../../components/ILIAS/UI/resources/images/media/bigplay.svg'], diff --git a/components/ILIAS/Filesystem/tests/Util/Convert/ImageConversionTest.php b/components/ILIAS/Filesystem/tests/Util/Convert/ImageConversionTest.php index a7c90ca56ee7..6f828ef80aa7 100755 --- a/components/ILIAS/Filesystem/tests/Util/Convert/ImageConversionTest.php +++ b/components/ILIAS/Filesystem/tests/Util/Convert/ImageConversionTest.php @@ -155,7 +155,7 @@ public function testResizeToFitWidth( ); } - public function getImageSizesByHeight(): array + public static function getImageSizesByHeight(): array { return [ [400, 300, self::BY_HEIGHT_FINAL, 1008], @@ -242,7 +242,7 @@ public function testResizeByFixedSize( $this->assertEquals($final_height, $new_dimensions[self::H]); } - public function getImageOptions(): array + public static function getImageOptions(): array { $options = new ImageOutputOptions(); return [ @@ -307,7 +307,7 @@ public function testImageOutputOptionSanity(): void $this->assertEquals(75, $options->getQuality()); // original options should not change } - public function getWrongFormats(): array + public static function getWrongFormats(): array { return [ ['gif'], @@ -326,7 +326,7 @@ public function testWrongFormats(string $format): void $wrong = $options->withFormat($format); } - public function getWrongQualites(): array + public static function getWrongQualites(): array { return [ [-1], @@ -390,7 +390,7 @@ public function testFailed(): void $this->assertInstanceOf(\Throwable::class, $resized->getThrowableIfAny()); } - public function getColors(): array + public static function getColors(): array { return [ [null], diff --git a/components/ILIAS/Filesystem/tests/Util/Convert/LegacyImageConversionTest.php b/components/ILIAS/Filesystem/tests/Util/Convert/LegacyImageConversionTest.php index 3f8b009ef64d..0eb2e6ff4b4e 100755 --- a/components/ILIAS/Filesystem/tests/Util/Convert/LegacyImageConversionTest.php +++ b/components/ILIAS/Filesystem/tests/Util/Convert/LegacyImageConversionTest.php @@ -40,7 +40,7 @@ protected function setUp(): void } - public function someDefinitions(): array + public static function someDefinitions(): array { return [ [100, 100, 'jpg', 'image/jpeg'], diff --git a/components/ILIAS/Filesystem/tests/Util/FilenameSanitizing.php b/components/ILIAS/Filesystem/tests/Util/FilenameSanitizing.php index 99ea53479038..784d0747eb51 100755 --- a/components/ILIAS/Filesystem/tests/Util/FilenameSanitizing.php +++ b/components/ILIAS/Filesystem/tests/Util/FilenameSanitizing.php @@ -26,7 +26,7 @@ */ class FilenameSanitizing extends TestCase { - public function provideFilenames(): array + public static function provideFilenames(): array { return [ ["Control\u{00a0}Character", 'ControlCharacter'], diff --git a/components/ILIAS/Filesystem/tests/Util/UnzipTest.php b/components/ILIAS/Filesystem/tests/Util/UnzipTest.php index bb52b6815876..15f787fbdee7 100755 --- a/components/ILIAS/Filesystem/tests/Util/UnzipTest.php +++ b/components/ILIAS/Filesystem/tests/Util/UnzipTest.php @@ -212,18 +212,18 @@ private function directoryToArray(string $path_to_directory): array // PROVIDERS - public function getZips(): array + public static function getZips(): array { return [ - ['1_folder_mac.zip', false, 10, $this->directories_one, 15, $this->files_one], - ['1_folder_win.zip', false, 10, $this->directories_one, 15, $this->files_one], - ['3_folders_mac.zip', true, 9, $this->directories_three, 12, $this->files_three], - ['3_folders_win.zip', true, 9, $this->directories_three, 12, $this->files_three], - ['1_folder_1_file_mac.zip', true, 3, $this->directories_mixed, 5, $this->files_mixed] + ['1_folder_mac.zip', false, 10, self::$directories_one, 15, self::$files_one], + ['1_folder_win.zip', false, 10, self::$directories_one, 15, self::$files_one], + ['3_folders_mac.zip', true, 9, self::$directories_three, 12, self::$files_three], + ['3_folders_win.zip', true, 9, self::$directories_three, 12, self::$files_three], + ['1_folder_1_file_mac.zip', true, 3, self::$directories_mixed, 5, self::$files_mixed] ]; } - protected array $files_mixed = [ + protected static array $files_mixed = [ 0 => '03_Test.pdf', 1 => 'Ordner A/01_Test.pdf', 2 => 'Ordner A/02_Test.pdf', @@ -231,13 +231,13 @@ public function getZips(): array 4 => 'Ordner A/Ordner A_2/08_Test.pdf' ]; - protected array $directories_mixed = [ + protected static array $directories_mixed = [ 0 => 'Ordner A/', 1 => 'Ordner A/Ordner A_1/', 2 => 'Ordner A/Ordner A_2/' ]; - protected array $directories_one = [ + protected static array $directories_one = [ 0 => 'Ordner 0/', 1 => 'Ordner 0/Ordner A/', 2 => 'Ordner 0/Ordner A/Ordner A_1/', @@ -249,7 +249,7 @@ public function getZips(): array 8 => 'Ordner 0/Ordner C/Ordner C_1/', 9 => 'Ordner 0/Ordner C/Ordner C_2/' ]; - protected array $directories_three = [ + protected static array $directories_three = [ 0 => 'Ordner A/', 1 => 'Ordner A/Ordner A_1/', 2 => 'Ordner A/Ordner A_2/', @@ -261,7 +261,7 @@ public function getZips(): array 8 => 'Ordner C/Ordner C_2/' ]; - protected array $files_one = [ + protected static array $files_one = [ 0 => 'Ordner 0/13_Test.pdf', 1 => 'Ordner 0/14_Test.pdf', 2 => 'Ordner 0/15_Test.pdf', @@ -279,7 +279,7 @@ public function getZips(): array 14 => 'Ordner 0/Ordner C/Ordner C_2/12_Test.pdf' ]; - protected array $files_three = [ + protected static array $files_three = [ 0 => 'Ordner A/01_Test.pdf', 1 => 'Ordner A/02_Test.pdf', 2 => 'Ordner A/Ordner A_2/07_Test.pdf', @@ -294,7 +294,7 @@ public function getZips(): array 11 => 'Ordner C/Ordner C_2/12_Test.pdf', ]; - protected array $top_directory_tree = [ + protected static array $top_directory_tree = [ 0 => '3_folders_mac/', 1 => '3_folders_mac/Ordner A/', 2 => '3_folders_mac/Ordner A/01_Test.pdf', @@ -319,7 +319,7 @@ public function getZips(): array 21 => '3_folders_mac/Ordner C/Ordner C_2/12_Test.pdf', ]; - private array $expected_flat_files = [ + private static array $expected_flat_files = [ 0 => '01_Test.pdf', 1 => '02_Test.pdf', 2 => '03_Test.pdf', diff --git a/components/ILIAS/Filesystem/tests/Util/ZipTest.php b/components/ILIAS/Filesystem/tests/Util/ZipTest.php index 42b080ef7bdb..9a592d1b6b60 100755 --- a/components/ILIAS/Filesystem/tests/Util/ZipTest.php +++ b/components/ILIAS/Filesystem/tests/Util/ZipTest.php @@ -264,18 +264,18 @@ private function directoryToArray(string $path_to_directory): array // PROVIDERS - public function getZips(): array + public static function getZips(): array { return [ - ['1_folder_mac.zip', false, 10, $this->directories_one, 15, $this->files_one], - ['1_folder_win.zip', false, 10, $this->directories_one, 15, $this->files_one], - ['3_folders_mac.zip', true, 9, $this->directories_three, 12, $this->files_three], - ['3_folders_win.zip', true, 9, $this->directories_three, 12, $this->files_three], - ['1_folder_1_file_mac.zip', true, 3, $this->directories_mixed, 5, $this->files_mixed] + ['1_folder_mac.zip', false, 10, self::$directories_one, 15, self::$files_one], + ['1_folder_win.zip', false, 10, self::$directories_one, 15, self::$files_one], + ['3_folders_mac.zip', true, 9, self::$directories_three, 12, self::$files_three], + ['3_folders_win.zip', true, 9, self::$directories_three, 12, self::$files_three], + ['1_folder_1_file_mac.zip', true, 3, self::$directories_mixed, 5, self::$files_mixed] ]; } - protected array $files_mixed = [ + protected static array $files_mixed = [ 0 => '03_Test.pdf', 1 => 'Ordner A/01_Test.pdf', 2 => 'Ordner A/02_Test.pdf', @@ -283,13 +283,13 @@ public function getZips(): array 4 => 'Ordner A/Ordner A_2/08_Test.pdf' ]; - protected array $directories_mixed = [ + protected static array $directories_mixed = [ 0 => 'Ordner A/', 1 => 'Ordner A/Ordner A_1/', 2 => 'Ordner A/Ordner A_2/' ]; - protected array $directories_one = [ + protected static array $directories_one = [ 0 => 'Ordner 0/', 1 => 'Ordner 0/Ordner A/', 2 => 'Ordner 0/Ordner A/Ordner A_1/', @@ -301,7 +301,7 @@ public function getZips(): array 8 => 'Ordner 0/Ordner C/Ordner C_1/', 9 => 'Ordner 0/Ordner C/Ordner C_2/' ]; - protected array $directories_three = [ + protected static array $directories_three = [ 0 => 'Ordner A/', 1 => 'Ordner A/Ordner A_1/', 2 => 'Ordner A/Ordner A_2/', @@ -313,7 +313,7 @@ public function getZips(): array 8 => 'Ordner C/Ordner C_2/' ]; - protected array $files_one = [ + protected static array $files_one = [ 0 => 'Ordner 0/13_Test.pdf', 1 => 'Ordner 0/14_Test.pdf', 2 => 'Ordner 0/15_Test.pdf', @@ -331,7 +331,7 @@ public function getZips(): array 14 => 'Ordner 0/Ordner C/Ordner C_2/12_Test.pdf' ]; - protected array $files_three = [ + protected static array $files_three = [ 0 => 'Ordner A/01_Test.pdf', 1 => 'Ordner A/02_Test.pdf', 2 => 'Ordner A/Ordner A_2/07_Test.pdf', diff --git a/components/ILIAS/Forum/tests/ForumNotificationCacheTest.php b/components/ILIAS/Forum/tests/ForumNotificationCacheTest.php index 38dc4b1935d0..65aeac816bbb 100755 --- a/components/ILIAS/Forum/tests/ForumNotificationCacheTest.php +++ b/components/ILIAS/Forum/tests/ForumNotificationCacheTest.php @@ -43,7 +43,7 @@ public function testCacheItemResultsInCacheHit(): void $this->assertSame('ilias', $cache->fetch('item')); } - public function nonScalarValuesProvider(): array + public static function nonScalarValuesProvider(): array { return [ 'Array Type' => [[4]], @@ -64,7 +64,7 @@ public function testExceptionIsRaisedWhenKeyShouldBeBuiltWithNonScalarValues($no $cache->createKeyByValues([$nonScalarValue, $nonScalarValue]); } - public function scalarValuesAndNullProvider(): array + public static function scalarValuesAndNullProvider(): array { return [ 'Float Type' => [4.0], diff --git a/components/ILIAS/GlobalScreen/tests/Toast/StandardToastTest.php b/components/ILIAS/GlobalScreen/tests/Toast/StandardToastTest.php index dc2019e6e34a..876669f7de9e 100755 --- a/components/ILIAS/GlobalScreen/tests/Toast/StandardToastTest.php +++ b/components/ILIAS/GlobalScreen/tests/Toast/StandardToastTest.php @@ -68,7 +68,7 @@ public function testStandardToast() $standard_toast = $standard_toast->withAdditionToastAction($this->factory->action('two', 'Two', $handle)); } - public function reservedActionsProvider(): array + public static function reservedActionsProvider(): array { $action = function () { return true; diff --git a/components/ILIAS/Html/tests/ilHtmlPurifierCompositeTest.php b/components/ILIAS/Html/tests/ilHtmlPurifierCompositeTest.php index 8638eeeec7f9..1f5ab9341074 100755 --- a/components/ILIAS/Html/tests/ilHtmlPurifierCompositeTest.php +++ b/components/ILIAS/Html/tests/ilHtmlPurifierCompositeTest.php @@ -98,7 +98,7 @@ public function testPurifierNodesAreCalledIfArrayOfStringGetssPurified(): void /** * @return array{integer: int[], float: float[], null: null[], array: never[][], object: \stdClass[], bool: false[], resource: resource[]|false[]} */ - public function invalidHtmlDataTypeProvider(): array + public static function invalidHtmlDataTypeProvider(): array { return [ 'integer' => [5], diff --git a/components/ILIAS/Html/tests/ilHtmlPurifierLibWrapperTest.php b/components/ILIAS/Html/tests/ilHtmlPurifierLibWrapperTest.php index 78288ffddd32..4e6cf59a9ca4 100755 --- a/components/ILIAS/Html/tests/ilHtmlPurifierLibWrapperTest.php +++ b/components/ILIAS/Html/tests/ilHtmlPurifierLibWrapperTest.php @@ -53,7 +53,7 @@ public function testPurifierIsCalledIfStringsArePurified(): void /** * @return array{integer: int[], float: float[], null: null[], array: never[][], object: \stdClass[], bool: false[], resource: resource[]|false[]} */ - public function invalidHtmlDataTypeProvider(): array + public static function invalidHtmlDataTypeProvider(): array { return [ 'integer' => [5], diff --git a/components/ILIAS/IndividualAssessment/tests/Members/ilIndividualAssessmentMemberTest.php b/components/ILIAS/IndividualAssessment/tests/Members/ilIndividualAssessmentMemberTest.php index 8ed6689c6fb9..7c15789a9dc9 100755 --- a/components/ILIAS/IndividualAssessment/tests/Members/ilIndividualAssessmentMemberTest.php +++ b/components/ILIAS/IndividualAssessment/tests/Members/ilIndividualAssessmentMemberTest.php @@ -300,7 +300,7 @@ public function test_finalized(): void $this->assertTrue($obj->finalized()); } - public function fileNamesDataProvider(): array + public static function fileNamesDataProvider(): array { return [ [''], @@ -342,7 +342,7 @@ public function test_mayBeFinalized_file_required_filename_empty(?string $filena $this->assertFalse($obj->mayBeFinalized()); } - public function positiveLPStatusDataProvider(): array + public static function positiveLPStatusDataProvider(): array { return [ [ilIndividualAssessmentMembers::LP_COMPLETED], @@ -425,7 +425,7 @@ public function test_mayBeFinalized_already_finalized(): void $this->assertFalse($obj->mayBeFinalized()); } - public function negativeLPStatusDataProvider(): array + public static function negativeLPStatusDataProvider(): array { return [ [ilIndividualAssessmentMembers::LP_NOT_ATTEMPTED], diff --git a/components/ILIAS/IndividualAssessment/tests/Members/ilIndividualAssessmentMembersStorageDBTest.php b/components/ILIAS/IndividualAssessment/tests/Members/ilIndividualAssessmentMembersStorageDBTest.php index 607af7cd33eb..d175222ab7ae 100755 --- a/components/ILIAS/IndividualAssessment/tests/Members/ilIndividualAssessmentMembersStorageDBTest.php +++ b/components/ILIAS/IndividualAssessment/tests/Members/ilIndividualAssessmentMembersStorageDBTest.php @@ -627,7 +627,7 @@ public function test_removeMembersRecord(): void $obj->removeMembersRecord($iass, $record); } - public function dataFor_getWhereFromFilter(): array + public static function dataFor_getWhereFromFilter(): array { return [ [ diff --git a/components/ILIAS/LegalDocuments/tests/AdministrationEditLinksTest.php b/components/ILIAS/LegalDocuments/tests/AdministrationEditLinksTest.php index cdff4812f64a..356a0942f013 100755 --- a/components/ILIAS/LegalDocuments/tests/AdministrationEditLinksTest.php +++ b/components/ILIAS/LegalDocuments/tests/AdministrationEditLinksTest.php @@ -57,7 +57,7 @@ public function testMethods(string $method, string $target, int $argc): void $this->assertSame('my-link', $instance->$method(...$args)); } - public function methods(): array + public static function methods(): array { return [ ['addCriterion', 'targetWithDoc', 1], diff --git a/components/ILIAS/LegalDocuments/tests/ConductorTest.php b/components/ILIAS/LegalDocuments/tests/ConductorTest.php index ba6fc3480407..686e15afe9f6 100755 --- a/components/ILIAS/LegalDocuments/tests/ConductorTest.php +++ b/components/ILIAS/LegalDocuments/tests/ConductorTest.php @@ -328,7 +328,7 @@ public function testUserManagementFields(): void ], $instance->userManagementFields($this->mock(ilObjUser::class))); } - public function agreeTypes(): array + public static function agreeTypes(): array { return [ 'Form type' => [ilLegalDocumentsAgreementGUI::class, 'agreement-form'], diff --git a/components/ILIAS/LegalDocuments/tests/ConsumerToolbox/UserTest.php b/components/ILIAS/LegalDocuments/tests/ConsumerToolbox/UserTest.php index cc24a3f69252..3382a2af9d7c 100755 --- a/components/ILIAS/LegalDocuments/tests/ConsumerToolbox/UserTest.php +++ b/components/ILIAS/LegalDocuments/tests/ConsumerToolbox/UserTest.php @@ -369,7 +369,7 @@ public function testRaw(): void $this->assertSame($user, $instance->raw()); } - public function externalAuthModes(): array + public static function externalAuthModes(): array { return [ 'lti' => [ilAuthUtils::AUTH_PROVIDER_LTI, true], diff --git a/components/ILIAS/LegalDocuments/tests/HTMLPurifierTest.php b/components/ILIAS/LegalDocuments/tests/HTMLPurifierTest.php index 32844add91bf..e5b8ceb16c38 100755 --- a/components/ILIAS/LegalDocuments/tests/HTMLPurifierTest.php +++ b/components/ILIAS/LegalDocuments/tests/HTMLPurifierTest.php @@ -58,7 +58,7 @@ public function testPurify(string $input, string $expected): void $this->assertSame($expected, $instance->purify($input)); } - public function documents(): array + public static function documents(): array { return [ 'Simple HTML Elements' => [ diff --git a/components/ILIAS/LegalDocuments/tests/LazyProvideTest.php b/components/ILIAS/LegalDocuments/tests/LazyProvideTest.php index ca930a693716..0f05b451f333 100755 --- a/components/ILIAS/LegalDocuments/tests/LazyProvideTest.php +++ b/components/ILIAS/LegalDocuments/tests/LazyProvideTest.php @@ -55,7 +55,7 @@ public function testMethods(string $method): void $this->assertTrue($called); } - public function methods(): array + public static function methods(): array { return [ ['withdrawal'], diff --git a/components/ILIAS/LegalDocuments/tests/ValidHTMLTest.php b/components/ILIAS/LegalDocuments/tests/ValidHTMLTest.php index 9993d5f12dbd..3dc14b797173 100755 --- a/components/ILIAS/LegalDocuments/tests/ValidHTMLTest.php +++ b/components/ILIAS/LegalDocuments/tests/ValidHTMLTest.php @@ -41,7 +41,7 @@ public function testIsTrue(string $text, bool $result): void $this->assertSame($result, $instance->isTrue($text)); } - public function textProvider(): array + public static function textProvider(): array { return [ 'Plain Text' => ['phpunit', false], diff --git a/components/ILIAS/Mail/tests/ilMailAddressListTest.php b/components/ILIAS/Mail/tests/ilMailAddressListTest.php index 526e9e489a74..164f8b7dc854 100755 --- a/components/ILIAS/Mail/tests/ilMailAddressListTest.php +++ b/components/ILIAS/Mail/tests/ilMailAddressListTest.php @@ -24,7 +24,7 @@ */ class ilMailAddressListTest extends ilMailBaseTest { - public function addressTestProvider(): array + public static function addressTestProvider(): array { return [ 'Username Addresses' => [ @@ -68,7 +68,7 @@ public function testDiffAddressListCanCalculateTheDifferenceOfTwoLists( $this->assertCount($numberOfExpectedItems, $list->value()); } - public function externalAddressTestProvider(): array + public static function externalAddressTestProvider(): array { return [ 'Username' => [ diff --git a/components/ILIAS/Mail/tests/ilMailAddressParserTest.php b/components/ILIAS/Mail/tests/ilMailAddressParserTest.php index 905c059b2d37..89ad981957c7 100755 --- a/components/ILIAS/Mail/tests/ilMailAddressParserTest.php +++ b/components/ILIAS/Mail/tests/ilMailAddressParserTest.php @@ -29,7 +29,7 @@ class ilMailAddressParserTest extends ilMailBaseTest /** * @return array[] */ - public function emailAddressesProvider(): array + public static function emailAddressesProvider(): array { return [ 'Username Addresses' => [ @@ -109,7 +109,7 @@ public function emailAddressesProvider(): array /** * @return array[] */ - public function emailInvalidAddressesProvider(): array + public static function emailInvalidAddressesProvider(): array { return [ 'Trailing Quote in Local Part' => [ diff --git a/components/ILIAS/Mail/tests/ilMailAutoresponderServiceTest.php b/components/ILIAS/Mail/tests/ilMailAutoresponderServiceTest.php index baf5de190940..6450bbeeba26 100755 --- a/components/ILIAS/Mail/tests/ilMailAutoresponderServiceTest.php +++ b/components/ILIAS/Mail/tests/ilMailAutoresponderServiceTest.php @@ -128,7 +128,7 @@ private function createAutoresponderRecord( ); } - public function autoresponderProvider(): Generator + public static function autoresponderProvider(): Generator { $now = new DateTimeImmutable('now', new DateTimeZone('UTC')); diff --git a/components/ILIAS/Mail/tests/ilMailBodyPurifierTest.php b/components/ILIAS/Mail/tests/ilMailBodyPurifierTest.php index 822ec536067e..40ce2193f674 100755 --- a/components/ILIAS/Mail/tests/ilMailBodyPurifierTest.php +++ b/components/ILIAS/Mail/tests/ilMailBodyPurifierTest.php @@ -20,7 +20,7 @@ class ilMailBodyPurifierTest extends ilMailBaseTest { - public function bodyProvider(): array + public static function bodyProvider(): array { return [ 'Reply indicators are kept' => [ diff --git a/components/ILIAS/Mail/tests/ilMailErrorFormatterTest.php b/components/ILIAS/Mail/tests/ilMailErrorFormatterTest.php index a56602ab89a6..9ffbbdb70ad4 100755 --- a/components/ILIAS/Mail/tests/ilMailErrorFormatterTest.php +++ b/components/ILIAS/Mail/tests/ilMailErrorFormatterTest.php @@ -46,7 +46,7 @@ protected function setUp(): void $this->errorFormatter = new ilMailErrorFormatter($languageMock); } - public function errorCollectionProvider(): array + public static function errorCollectionProvider(): array { return [ 'Zero errors' => [ diff --git a/components/ILIAS/Mail/tests/ilMailMimeSubjectBuilderTest.php b/components/ILIAS/Mail/tests/ilMailMimeSubjectBuilderTest.php index a825967894bd..9c5ffaffddf7 100755 --- a/components/ILIAS/Mail/tests/ilMailMimeSubjectBuilderTest.php +++ b/components/ILIAS/Mail/tests/ilMailMimeSubjectBuilderTest.php @@ -28,7 +28,7 @@ class ilMailMimeSubjectBuilderTest extends ilMailBaseTest /** * @return array> */ - public function globalSubjectPrefixOnlyProvider(): array + public static function globalSubjectPrefixOnlyProvider(): array { return [ 'Global Prefix without Brackets' => ['docu', 'docu %s'], @@ -39,7 +39,7 @@ public function globalSubjectPrefixOnlyProvider(): array /** * @return array> */ - public function subjectPrefixesProvider(): array + public static function subjectPrefixesProvider(): array { return [ 'Global Prefix without Brackets and Additional Context Prefix' => ['docu', 'Course', '[docu : Course] %s'], diff --git a/components/ILIAS/Mail/tests/ilMailOptionsTest.php b/components/ILIAS/Mail/tests/ilMailOptionsTest.php index 8ebd71c5f82c..c74b5cb35614 100755 --- a/components/ILIAS/Mail/tests/ilMailOptionsTest.php +++ b/components/ILIAS/Mail/tests/ilMailOptionsTest.php @@ -164,7 +164,7 @@ public function testIsAbsent(bool $absence_status, int $absent_from, int $absent $this->assertEquals($result, $mailOptions->isAbsent()); } - public function provideMailOptionsData(): Generator + public static function provideMailOptionsData(): Generator { yield 'correct configuration' => [ 'absence_status' => true, diff --git a/components/ILIAS/Mail/tests/ilMailTest.php b/components/ILIAS/Mail/tests/ilMailTest.php index 6dd5140eeea3..2dd419df8d9d 100755 --- a/components/ILIAS/Mail/tests/ilMailTest.php +++ b/components/ILIAS/Mail/tests/ilMailTest.php @@ -248,7 +248,7 @@ public function testGetPreviousMail(array $rowData): void $instance->getPreviousMail($mailId); } - public function provideGetPreviousMail(): array + public static function provideGetPreviousMail(): array { return [ [[]], diff --git a/components/ILIAS/Maps/tests/ilMapGUITest.php b/components/ILIAS/Maps/tests/ilMapGUITest.php index 7330bdf053de..4c6db841422c 100755 --- a/components/ILIAS/Maps/tests/ilMapGUITest.php +++ b/components/ILIAS/Maps/tests/ilMapGUITest.php @@ -52,7 +52,7 @@ public function testSettersAndGetters($name, $value): void $this->assertEquals($value, $this->gui->$get()); } - public function properties(): array + public static function properties(): array { return [ ["MapId", "a_map_id"], diff --git a/components/ILIAS/Math/tests/ilMathBaseAdapterTest.php b/components/ILIAS/Math/tests/ilMathBaseAdapterTest.php index cab61adca3b7..d9ca718265c6 100755 --- a/components/ILIAS/Math/tests/ilMathBaseAdapterTest.php +++ b/components/ILIAS/Math/tests/ilMathBaseAdapterTest.php @@ -152,7 +152,7 @@ public function testModuloByZero(): void /** * @return array */ - public function addData(): array + public static function addData(): array { return [ ['1', '2', '3', self::DEFAULT_SCALE] diff --git a/components/ILIAS/Math/tests/ilMathTest.php b/components/ILIAS/Math/tests/ilMathTest.php index 71e19455ac5e..2c953f43a5ea 100755 --- a/components/ILIAS/Math/tests/ilMathTest.php +++ b/components/ILIAS/Math/tests/ilMathTest.php @@ -44,7 +44,7 @@ public function testGcd(string $a, string $b, string $result): void /** * @return array> */ - public function gcdData(): array + public static function gcdData(): array { return [ ['1254', '5298', '6'], diff --git a/components/ILIAS/MathJax/tests/class.ilMathJaxTest.php b/components/ILIAS/MathJax/tests/class.ilMathJaxTest.php index de4b1ecee544..d4c94abced90 100755 --- a/components/ILIAS/MathJax/tests/class.ilMathJaxTest.php +++ b/components/ILIAS/MathJax/tests/class.ilMathJaxTest.php @@ -44,7 +44,7 @@ public function testClientSideRendering(int $limiter, string $input, ?string $st $this->assertEquals($expected, $result, 'input: ' . $input); } - public function clientSideData(): array + public static function clientSideData(): array { return [ [0, '[tex]e=m*c^2[/tex]', null, null, '\(e=m*c^2\)'], @@ -87,7 +87,7 @@ public function testServerSideRendering(string $purpose, ?string $imagefile, str $this->assertEquals($expected, $head, 'purpose: ' . $purpose); } - public function serverSideData(): array + public static function serverSideData(): array { return [ ['browser', 'example.svg', 'transform($origValue); } - public function ArrayToListTransformationDataProvider(): array + public static function ArrayToListTransformationDataProvider(): array { return [ 'first_arr' => [['hello', 'world'], ['hello', 'world']], @@ -61,7 +61,7 @@ public function ArrayToListTransformationDataProvider(): array ]; } - public function ArrayFailureDataProvider(): array + public static function ArrayFailureDataProvider(): array { return [ 'null_array' => [[null]], diff --git a/components/ILIAS/Refinery/tests/KindlyTo/Transformation/NullTransformationTest.php b/components/ILIAS/Refinery/tests/KindlyTo/Transformation/NullTransformationTest.php index 7a9b6a912549..1c892ce3a35f 100755 --- a/components/ILIAS/Refinery/tests/KindlyTo/Transformation/NullTransformationTest.php +++ b/components/ILIAS/Refinery/tests/KindlyTo/Transformation/NullTransformationTest.php @@ -31,7 +31,7 @@ protected function setUp(): void $this->transformation = new NullTransformation(); } - public function NullTestDataProvider(): array + public static function NullTestDataProvider(): array { return [ 'empty string' => ['', true], diff --git a/components/ILIAS/Refinery/tests/KindlyTo/Transformation/RecordTransformationTest.php b/components/ILIAS/Refinery/tests/KindlyTo/Transformation/RecordTransformationTest.php index abaf3585dd3a..ed6a980425e2 100755 --- a/components/ILIAS/Refinery/tests/KindlyTo/Transformation/RecordTransformationTest.php +++ b/components/ILIAS/Refinery/tests/KindlyTo/Transformation/RecordTransformationTest.php @@ -110,7 +110,7 @@ public function testInvalidValueDoesNotMatch(array $originalValue): void $this->fail(); } - public function RecordTransformationDataProvider(): array + public static function RecordTransformationDataProvider(): array { return [ "exact_form" => [['stringKey' => 'hello', 'integerKey' => 1], ['stringKey' => 'hello', 'integerKey' => 1]], @@ -122,7 +122,7 @@ public function RecordTransformationDataProvider(): array ]; } - public function RecordFailureDataProvider(): array + public static function RecordFailureDataProvider(): array { return [ 'too_little_values' => [['stringKey' => 'hello']], @@ -131,7 +131,7 @@ public function RecordFailureDataProvider(): array ]; } - public function RecordValueInvalidDataProvider(): array + public static function RecordValueInvalidDataProvider(): array { return [ 'invalid_value' => [['stringKey' => 'hello', 'integerKey2' => 1]] diff --git a/components/ILIAS/Refinery/tests/KindlyTo/Transformation/StringTransformationTest.php b/components/ILIAS/Refinery/tests/KindlyTo/Transformation/StringTransformationTest.php index 4952b5d6b54d..541d4242b175 100755 --- a/components/ILIAS/Refinery/tests/KindlyTo/Transformation/StringTransformationTest.php +++ b/components/ILIAS/Refinery/tests/KindlyTo/Transformation/StringTransformationTest.php @@ -45,7 +45,7 @@ public function testStringTransformation($originVal, string $expectedVal): void $this->assertEquals($expectedVal, $transformedValue); } - public function StringTestDataProvider(): array + public static function StringTestDataProvider(): array { $obj = new class () extends stdClass { public function __toString() diff --git a/components/ILIAS/Refinery/tests/KindlyTo/Transformation/TupleTransformationTest.php b/components/ILIAS/Refinery/tests/KindlyTo/Transformation/TupleTransformationTest.php index 526af953da1a..de25d04ce72d 100755 --- a/components/ILIAS/Refinery/tests/KindlyTo/Transformation/TupleTransformationTest.php +++ b/components/ILIAS/Refinery/tests/KindlyTo/Transformation/TupleTransformationTest.php @@ -91,21 +91,21 @@ public function testTupleTooManyValues(array $tooManyValues): void $this->fail(); } - public function TupleTooManyValuesDataProvider(): array + public static function TupleTooManyValuesDataProvider(): array { return [ 'too_many_values' => [[1,2,3]] ]; } - public function TupleFailingTransformationDataProvider(): array + public static function TupleFailingTransformationDataProvider(): array { return [ 'incorrect_tuple' => [[1, 2]] ]; } - public function TupleTransformationDataProvider(): array + public static function TupleTransformationDataProvider(): array { return [ 'array_test01' => [[1, 2], [1, 2]] diff --git a/components/ILIAS/Refinery/tests/Logical/Constraint/LogicalOrTest.php b/components/ILIAS/Refinery/tests/Logical/Constraint/LogicalOrTest.php index 85b464c57a8f..1e877c412228 100755 --- a/components/ILIAS/Refinery/tests/Logical/Constraint/LogicalOrTest.php +++ b/components/ILIAS/Refinery/tests/Logical/Constraint/LogicalOrTest.php @@ -117,12 +117,20 @@ public function testWithProblemBuilder(LogicalOr $constraint, $okValue, $errorVa /** * @return array */ - public function constraintsProvider(): array + public static function constraintsProvider(): array { - $mock = $this->getMockBuilder(\ILIAS\Language\Language::class)->disableOriginalConstructor()->getMock(); + $language = new class () implements \ILIAS\Language\Language { + public function txt(string $a_topic, string $a_default_lang_fallback_mod = ""): string + { + return $a_topic; + } + public function loadLanguageModule(string $a_module): void + { + } + }; $data_factory = new DataFactory(); - $refinery = new Refinery($data_factory, $mock); + $refinery = new Refinery($data_factory, $language); return [ [ $refinery->logical()->logicalOr([ diff --git a/components/ILIAS/Refinery/tests/Parser/ABNF/BrickTest.php b/components/ILIAS/Refinery/tests/Parser/ABNF/BrickTest.php index 25da0923187e..16e566d0f108 100755 --- a/components/ILIAS/Refinery/tests/Parser/ABNF/BrickTest.php +++ b/components/ILIAS/Refinery/tests/Parser/ABNF/BrickTest.php @@ -44,9 +44,9 @@ public function testApply(): void $ok->method('value')->willReturn($expected); $intermediate = $this->getMockBuilder(Intermediate::class)->disableOriginalConstructor()->getMock(); $intermediate->method('done')->willReturn(true); - $intermediate->method('transform')->willReturnCallback(fn () => $ok); + $intermediate->method('transform')->willReturnCallback(fn() => $ok); $brick = new Brick(); - $result = $brick->apply(static fn (Intermediate $x, Closure $cc): Result => ( + $result = $brick->apply(static fn(Intermediate $x, Closure $cc): Result => ( $cc(new Ok($intermediate)) ), 'abcde'); @@ -61,7 +61,7 @@ public function testThatAllInputMustBeConsumed(): void $intermediate->expects(self::never())->method('transform'); $brick = new Brick(); - $result = $brick->apply(static fn (Intermediate $x, Closure $cc): Result => ( + $result = $brick->apply(static fn(Intermediate $x, Closure $cc): Result => ( $cc(new Ok($intermediate)) ), 'abcde'); @@ -71,7 +71,7 @@ public function testThatAllInputMustBeConsumed(): void public function testAFailingParser(): void { $brick = new Brick(); - $result = $brick->apply(static fn (Intermediate $x, Closure $cc): Result => ( + $result = $brick->apply(static fn(Intermediate $x, Closure $cc): Result => ( $cc(new Error('something happened')) ), 'abcde'); @@ -175,7 +175,7 @@ public function testRepeat(int $min, ?int $max, array $succeed, array $fail): vo } } - public function repeatProvider(): array + public static function repeatProvider(): array { return [ 'Ranges are inclusive' => [3, 3, ['abc'], ['ab', 'abcd']], @@ -205,17 +205,17 @@ public function testCharacters(string $method, string $input, bool $isOk): void } } - private function breakIntoPieces(int $x, string $break_me): array + private static function breakIntoPieces(int $x, string $break_me): array { $len = (int) floor(strlen($break_me) / $x); return array_map( - fn ($i) => substr($break_me, $i * $len, $len), + fn($i) => substr($break_me, $i * $len, $len), range(0, $x - !(strlen($break_me) % $x)) ); } - public function characterProvider(): array + public static function characterProvider(): array { $alpha = array_fill(ord('a'), ord('z') - ord('a') + 1, ''); array_walk($alpha, function (&$value, int $i) { @@ -225,7 +225,7 @@ public function characterProvider(): array $alpha .= strtoupper($alpha); // Circumvent error when running this test with Xdebug. The default value of xdebug.max_nesting_level will kill the test. - $alpha_parts = $this->breakIntoPieces(3, $alpha); + $alpha_parts = self::breakIntoPieces(3, $alpha); $digits = '1234567890'; @@ -252,7 +252,7 @@ public function testEmptyString(string $input, bool $isOk): void $this->assertEquals($isOk, $result->isOk()); } - public function emptyStringProvider(): array + public static function emptyStringProvider(): array { return [ 'Test empty input' => ['', true], @@ -260,7 +260,7 @@ public function emptyStringProvider(): array ]; } - public function testTransfromation(): void + public function testTransformation(): void { $brick = new Brick(); @@ -277,7 +277,7 @@ public function testTransfromation(): void $transformation = $this->getMockBuilder(Transformation::class)->getMock(); $transformation->expects(self::once())->method('applyTo')->willReturn($ok); - $parser = $brick->transformation($transformation, fn ($x, $cc) => $cc(new Ok($x))); + $parser = $brick->transformation($transformation, fn($x, $cc) => $cc(new Ok($x))); $result = $brick->apply($parser, 'a'); diff --git a/components/ILIAS/Refinery/tests/Password/Constraint/PasswordContraintsTest.php b/components/ILIAS/Refinery/tests/Password/Constraint/PasswordContraintsTest.php index 0e3193e757be..059bd3eb0520 100755 --- a/components/ILIAS/Refinery/tests/Password/Constraint/PasswordContraintsTest.php +++ b/components/ILIAS/Refinery/tests/Password/Constraint/PasswordContraintsTest.php @@ -28,9 +28,17 @@ class PasswordContraintsTest extends TestCase * * @return array[[$constraint,$ok_values,$error_values]] */ - public function constraintsProvider(): array + public static function constraintsProvider(): array { - $lng = $this->createMock(\ILIAS\Language\Language::class); + $lng = new class () implements \ILIAS\Language\Language { + public function txt(string $a_topic, string $a_default_lang_fallback_mod = ""): string + { + return $a_topic; + } + public function loadLanguageModule(string $a_module): void + { + } + }; $d = new \ILIAS\Data\Factory(); $refinery = new \ILIAS\Refinery\Factory($d, $lng); $v = $refinery->password(); diff --git a/components/ILIAS/Refinery/tests/String/Encoding/EncodingTest.php b/components/ILIAS/Refinery/tests/String/Encoding/EncodingTest.php index 90f98404d7f1..ad639ef2454b 100644 --- a/components/ILIAS/Refinery/tests/String/Encoding/EncodingTest.php +++ b/components/ILIAS/Refinery/tests/String/Encoding/EncodingTest.php @@ -31,7 +31,7 @@ public function setUp(): void $this->group = new Group(); } - public function latin1StringProvider(): array + public static function latin1StringProvider(): array { // generate 500 random strings with ISO-8859-1 encoding. unfortunately, I was not able to find a list to copy // here which keeps it's encoding, therefore we must generate them randomly @@ -60,7 +60,7 @@ public function testLatin1ToUTF8( $this->assertEquals($expected_utf8, $result); } - public function asciiStringProvider(): array + public static function asciiStringProvider(): array { // generate 500 random strings with US-ASCII encosing. $strings = []; diff --git a/components/ILIAS/Refinery/tests/String/EstimatedReadingTimeTest.php b/components/ILIAS/Refinery/tests/String/EstimatedReadingTimeTest.php index b96c03c2a2a2..127e772fdd6f 100755 --- a/components/ILIAS/Refinery/tests/String/EstimatedReadingTimeTest.php +++ b/components/ILIAS/Refinery/tests/String/EstimatedReadingTimeTest.php @@ -57,7 +57,7 @@ protected function setUp(): void /** * @return array[] */ - public function inputProvider(): array + public static function inputProvider(): array { return [ [5], @@ -74,7 +74,7 @@ public function inputProvider(): array /** * @return array[] */ - public function unsupportedButKnownEntitiesProvider(): array + public static function unsupportedButKnownEntitiesProvider(): array { return array_map(static function (string $entity): array { return [ diff --git a/components/ILIAS/Refinery/tests/String/MakeClickableTest.php b/components/ILIAS/Refinery/tests/String/MakeClickableTest.php index f26b4106398b..b052517e78f2 100755 --- a/components/ILIAS/Refinery/tests/String/MakeClickableTest.php +++ b/components/ILIAS/Refinery/tests/String/MakeClickableTest.php @@ -58,17 +58,17 @@ public function testTransformSuccess(string $expected, string $input): void } - public function provideInputInNewTab(): array + public static function provideInputInNewTab(): array { - return $this->createInput(' target="_blank" rel="noopener"'); + return self::createInput(' target="_blank" rel="noopener"'); } - public function provideInputWithoutAttributes(): array + public static function provideInputWithoutAttributes(): array { - return $this->createInput(); + return self::createInput(); } - public function createInput(string $attributes = ''): array + public static function createInput(string $attributes = ''): array { $templates = [ 'test empty string' => ['', ''], diff --git a/components/ILIAS/Refinery/tests/String/MarkdownFormattingToHTMLTest.php b/components/ILIAS/Refinery/tests/String/MarkdownFormattingToHTMLTest.php index edff2b63c13e..56eb798305fc 100755 --- a/components/ILIAS/Refinery/tests/String/MarkdownFormattingToHTMLTest.php +++ b/components/ILIAS/Refinery/tests/String/MarkdownFormattingToHTMLTest.php @@ -42,7 +42,7 @@ protected function setUp(): void $this->markdown_with_escaped_html = $group->markdown()->toHTML(); } - public function stringProvider(): array + public static function stringProvider(): array { return [ ["lorem", "

lorem

\n"], diff --git a/components/ILIAS/Refinery/tests/String/UTFNormalTest.php b/components/ILIAS/Refinery/tests/String/UTFNormalTest.php index 0f873d5e6d8b..b1fcebdf2c44 100755 --- a/components/ILIAS/Refinery/tests/String/UTFNormalTest.php +++ b/components/ILIAS/Refinery/tests/String/UTFNormalTest.php @@ -48,7 +48,7 @@ public function setUp(): void $this->form_kd = $group->utfnormal()->formKD(); } - public function stringProvider(): array + public static function stringProvider(): array { // Never ever try to change something on this array :-) e.g. a 'ä' isn't a 'ä' but a 'ä' ;-) return [ diff --git a/components/ILIAS/Refinery/tests/To/Transformation/InArrayTransformationTest.php b/components/ILIAS/Refinery/tests/To/Transformation/InArrayTransformationTest.php index 8f08eea16322..a984fa95a429 100644 --- a/components/ILIAS/Refinery/tests/To/Transformation/InArrayTransformationTest.php +++ b/components/ILIAS/Refinery/tests/To/Transformation/InArrayTransformationTest.php @@ -78,7 +78,7 @@ public function testApplyTo(string $value, bool $successful): void } } - public function memberProvider(): array + public static function memberProvider(): array { return [ 'Invalid member.' => ['hej', false], diff --git a/components/ILIAS/ResourceStorage/tests/Flavours/FlavourMachineTest.php b/components/ILIAS/ResourceStorage/tests/Flavours/FlavourMachineTest.php index baa16e2981b5..b8661534c2a1 100755 --- a/components/ILIAS/ResourceStorage/tests/Flavours/FlavourMachineTest.php +++ b/components/ILIAS/ResourceStorage/tests/Flavours/FlavourMachineTest.php @@ -103,7 +103,7 @@ public function testFactory(): void $this->assertEquals(NoEngine::class, $null_machine->dependsOnEngine()); } - public function definitionsToMachines(): array + public static function definitionsToMachines(): array { return [ [new PagesToExtract(true), ExtractPages::class, ImagickEngineWithOptionalFFMpeg::class], @@ -130,7 +130,7 @@ public function testDefaultMachines(FlavourDefinition $d, string $machine): void $this->assertSame($machine_instance, $machine_instance_second_get); } - public function machinesToEngines(): array + public static function machinesToEngines(): array { return [ [ExtractPages::class, ImagickEngine::class], diff --git a/components/ILIAS/Setup/tests/Metrics/MetricTest.php b/components/ILIAS/Setup/tests/Metrics/MetricTest.php index d5e527b4b628..75f7d5974d5a 100755 --- a/components/ILIAS/Setup/tests/Metrics/MetricTest.php +++ b/components/ILIAS/Setup/tests/Metrics/MetricTest.php @@ -46,7 +46,7 @@ public function testConstructMetric(string $stability, string $type, $value, str $this->assertEquals($description, $metric->getDescription()); } - public function metricProvider(): array + public static function metricProvider(): array { $config = Metrics\Metric::STABILITY_CONFIG; $stable = Metrics\Metric::STABILITY_STABLE; @@ -123,7 +123,7 @@ public function testToYAML(M $metric, string $expected): void $this->assertEquals($expected, $metric->toYAML()); } - public function typedMetricsProvider(): array + public static function typedMetricsProvider(): array { return [ "bool_true" => [new M(M::STABILITY_STABLE, M::TYPE_BOOL, true), "true"], diff --git a/components/ILIAS/StaticURL/tests/LegacyGotoHandlerTest.php b/components/ILIAS/StaticURL/tests/LegacyGotoHandlerTest.php index da071145b6c8..dda4b8be961b 100755 --- a/components/ILIAS/StaticURL/tests/LegacyGotoHandlerTest.php +++ b/components/ILIAS/StaticURL/tests/LegacyGotoHandlerTest.php @@ -70,7 +70,7 @@ private function updateRequestAndWrapperMockWithParams(array $params): void $this->http_mock->method('wrapper')->willReturn(new WrapperFactory($this->request_mock)); } - public function urlProvider(): array + public static function urlProvider(): array { return [ ['https://ilias.domain/goto.php?client_id=unittest&target=impr', 'impr'], diff --git a/components/ILIAS/StaticURL/tests/URIBuilderTest.php b/components/ILIAS/StaticURL/tests/URIBuilderTest.php index 364446b30299..956651775a38 100755 --- a/components/ILIAS/StaticURL/tests/URIBuilderTest.php +++ b/components/ILIAS/StaticURL/tests/URIBuilderTest.php @@ -31,7 +31,7 @@ class URIBuilderTest extends Base private ?string $ilias_http_path_backup = null; private StandardURIBuilder $uri_builder; - public function getILIAS_HTTP_Paths(): array + public static function getILIAS_HTTP_Paths(): array { return [ ['https://ilias.de/ilias', 'https://ilias.de/ilias'], @@ -57,7 +57,7 @@ public function testBaseURI(string $ILIAS_HTTP_PATH, string $expected): void $this->assertEquals($expected, (string) $uri_builder->getBaseURI()); } - public function getBuilderParts(): array + public static function getBuilderParts(): array { return [ ['wiki', 42, [], 'https://test9.ilias.de/goto.php/wiki/42'], diff --git a/components/ILIAS/StudyProgramme/tests/model/Assignments/ilStudyProgrammeProgressTest.php b/components/ILIAS/StudyProgramme/tests/model/Assignments/ilStudyProgrammeProgressTest.php index 917641608900..a743056cef8a 100755 --- a/components/ILIAS/StudyProgramme/tests/model/Assignments/ilStudyProgrammeProgressTest.php +++ b/components/ILIAS/StudyProgramme/tests/model/Assignments/ilStudyProgrammeProgressTest.php @@ -238,7 +238,7 @@ public function testPRGProgressStatusActionsMarkNotRelevant(): void $this->assertTrue($pgs->hasIndividualModifications()); } - public function ilPRGProgressStatus(): array + public static function ilPRGProgressStatus(): array { return [ //status, count as 'successful' @@ -276,7 +276,7 @@ public function testPRGProgressAllowedTransitionsForInProgress(int $status): voi } /** - * @dataProvider status + * @dataProvider ilPRGProgressStatus */ public function testPRGProgressAllowedTransitionsForAccredited($status) { @@ -297,7 +297,7 @@ public function testPRGProgressAllowedTransitionsForAccredited($status) } /** - * @dataProvider status + * @dataProvider ilPRGProgressStatus */ public function testPRGProgressAllowedTransitionsForCompleted($status) { @@ -316,7 +316,7 @@ public function testPRGProgressAllowedTransitionsForCompleted($status) } /** - * @dataProvider status + * @dataProvider ilPRGProgressStatus */ public function testPRGProgressAllowedTransitionsForFailed($status) { @@ -336,7 +336,7 @@ public function testPRGProgressAllowedTransitionsForFailed($status) } /** - * @dataProvider status + * @dataProvider ilPRGProgressStatus */ public function testPRGProgressAllowedTransitionsForIrrelevant($status): void { diff --git a/components/ILIAS/Style/System/test/Exceptions/ilSystemStyleExceptionBaseUnit.php b/components/ILIAS/Style/System/test/Exceptions/ilSystemStyleExceptionBaseUnit.php index 2ec0c8e22e1d..fbacfb22ec98 100755 --- a/components/ILIAS/Style/System/test/Exceptions/ilSystemStyleExceptionBaseUnit.php +++ b/components/ILIAS/Style/System/test/Exceptions/ilSystemStyleExceptionBaseUnit.php @@ -26,7 +26,7 @@ abstract class ilSystemStyleExceptionBaseUnit extends TestCase { abstract protected function getClassName(): string; - public function codesProvider(): array + public static function codesProvider(): array { $reflection = new ReflectionClass($this->getClassName()); diff --git a/components/ILIAS/Test/tests/AccessFileUploadPreviewTest.php b/components/ILIAS/Test/tests/AccessFileUploadPreviewTest.php index 8a416dbaa3ca..bafc664d19fd 100644 --- a/components/ILIAS/Test/tests/AccessFileUploadPreviewTest.php +++ b/components/ILIAS/Test/tests/AccessFileUploadPreviewTest.php @@ -31,14 +31,14 @@ class AccessFileUploadPreviewTest extends TestCase { - public function testConstruct() : void + public function testConstruct(): void { $database = $this->getMockBuilder(ilDBInterface::class)->disableOriginalConstructor()->getMock(); $access = $this->getMockBuilder(ilAccessHandler::class)->getMock(); $this->assertInstanceOf(AccessFileUploadPreview::class, new AccessFileUploadPreview($database, $access)); } - public function testNoUploadPath() : void + public function testNoUploadPath(): void { $database = $this->getMockBuilder(ilDBInterface::class)->disableOriginalConstructor()->getMock(); $access = $this->getMockBuilder(ilAccessHandler::class)->getMock(); @@ -48,7 +48,7 @@ public function testNoUploadPath() : void $this->assertFalse($result->isOk()); } - public function testFalseWithInvalidId() : void + public function testFalseWithInvalidId(): void { $database = $this->getMockBuilder(ilDBInterface::class)->disableOriginalConstructor()->getMock(); $access = $this->getMockBuilder(ilAccessHandler::class)->getMock(); @@ -66,7 +66,7 @@ public function testFalseWithInvalidId() : void /** * @dataProvider types */ - public function testWithTypes(?string $type, bool $permitted, ?string $requires_permission) : void + public function testWithTypes(?string $type, bool $permitted, ?string $requires_permission): void { $database = $this->getMockBuilder(ilDBInterface::class)->disableOriginalConstructor()->getMock(); $access = $this->getMockBuilder(ilAccessHandler::class)->getMock(); @@ -81,7 +81,7 @@ public function testWithTypes(?string $type, bool $permitted, ?string $requires_ $database->expects(self::once())->method('queryF')->with('SELECT obj_fi FROM qpl_questions WHERE question_id = %s', [ilDBConstants::T_INTEGER], [383])->willReturn($statement); $database->expects(self::once())->method('fetchAssoc')->with($statement)->willReturn(['obj_fi' => '383']); - $incident->expects(self::once())->method('any')->willReturnCallback(function (callable $call_me, array $ref_ids) : bool { + $incident->expects(self::once())->method('any')->willReturnCallback(function (callable $call_me, array $ref_ids): bool { $this->assertEquals([987], $ref_ids); return $call_me(987); }); @@ -102,7 +102,7 @@ public function testWithTypes(?string $type, bool $permitted, ?string $requires_ $this->assertSame(1, $type_called); } - public function types() : array + public static function types(): array { return [ 'Type qpl with access rights.' => ['qpl', false, 'read'], diff --git a/components/ILIAS/Test/tests/AccessQuestionImageTest.php b/components/ILIAS/Test/tests/AccessQuestionImageTest.php index 1988187c3dbf..e1b6152de093 100755 --- a/components/ILIAS/Test/tests/AccessQuestionImageTest.php +++ b/components/ILIAS/Test/tests/AccessQuestionImageTest.php @@ -44,7 +44,7 @@ public function testIsPermittedWithInvalidPath(string $path): void $this->assertFalse($instance->isPermitted($path)->isOk()); } - public function invalidPaths(): array + public static function invalidPaths(): array { return [ ['foo'], @@ -71,7 +71,7 @@ public function testIsPermittedWithValidPath(bool $is_readable): void $this->assertSame($is_readable, $result->value()); } - public function isPermittedProvider(): array + public static function isPermittedProvider(): array { return [ 'With readable object path.' => [true], diff --git a/components/ILIAS/Test/tests/Exceptions/ilTestEvaluationExceptionTest.php b/components/ILIAS/Test/tests/Exceptions/ilTestEvaluationExceptionTest.php index 0161a372ae5a..4b0eba3f82e2 100644 --- a/components/ILIAS/Test/tests/Exceptions/ilTestEvaluationExceptionTest.php +++ b/components/ILIAS/Test/tests/Exceptions/ilTestEvaluationExceptionTest.php @@ -32,7 +32,7 @@ public function testConstruct(array $input, array $output): void $this->assertEquals($output['code'], $ilTestEvaluationException->getCode()); } - public function constructDataProvider(): array + public static function constructDataProvider(): array { return [ [['msg' => '', 'code' => -1], ['msg' => ilTestEvaluationException::class, 'code' => -1]], @@ -60,7 +60,7 @@ public function testException(array $input, array $output): void ; } - public function exceptionDataProvider(): array + public static function exceptionDataProvider(): array { return [ [['msg' => '', 'code' => -1], ['msg' => ilTestEvaluationException::class, 'code' => -1]], @@ -72,4 +72,4 @@ public function exceptionDataProvider(): array [['msg' => 'test'], ['msg' => 'test', 'code' => 0]] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/Exceptions/ilTestExceptionTest.php b/components/ILIAS/Test/tests/Exceptions/ilTestExceptionTest.php index 06862e0f21da..e748731cbb2c 100644 --- a/components/ILIAS/Test/tests/Exceptions/ilTestExceptionTest.php +++ b/components/ILIAS/Test/tests/Exceptions/ilTestExceptionTest.php @@ -32,7 +32,7 @@ public function testConstruct(array $input, array $output): void $this->assertEquals($output['code'], $ilTestException->getCode()); } - public function constructDataProvider(): array + public static function constructDataProvider(): array { return [ [['msg' => '', 'code' => -1], ['msg' => ilTestException::class, 'code' => -1]], @@ -60,7 +60,7 @@ public function testException(array $input, array $output): void ; } - public function exceptionDataProvider(): array + public static function exceptionDataProvider(): array { return [ [['msg' => '', 'code' => -1], ['msg' => ilTestException::class, 'code' => -1]], @@ -73,4 +73,4 @@ public function exceptionDataProvider(): array [['msg' => 'test'], ['msg' => 'test', 'code' => 0]] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/Exceptions/ilTestMissingQuestionPoolIdParameterExceptionTest.php b/components/ILIAS/Test/tests/Exceptions/ilTestMissingQuestionPoolIdParameterExceptionTest.php index 9d8edac0f41b..249fee582491 100644 --- a/components/ILIAS/Test/tests/Exceptions/ilTestMissingQuestionPoolIdParameterExceptionTest.php +++ b/components/ILIAS/Test/tests/Exceptions/ilTestMissingQuestionPoolIdParameterExceptionTest.php @@ -32,7 +32,7 @@ public function testConstruct(array $input, array $output): void $this->assertEquals($output['code'], $ilTestMissingQuestionPoolIdParameterException->getCode()); } - public function constructDataProvider(): array + public static function constructDataProvider(): array { return [ [['msg' => '', 'code' => -1], ['msg' => ilTestMissingQuestionPoolIdParameterException::class, 'code' => 0]], @@ -60,7 +60,7 @@ public function testException(array $input, array $output): void ; } - public function exceptionDataProvider(): array + public static function exceptionDataProvider(): array { return [ [['msg' => '', 'code' => -1], ['msg' => ilTestMissingQuestionPoolIdParameterException::class, 'code' => 0]], @@ -73,4 +73,4 @@ public function exceptionDataProvider(): array [['msg' => 'test'], ['msg' => ilTestMissingQuestionPoolIdParameterException::class, 'code' => 0]] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/Exceptions/ilTestMissingSourcePoolDefinitionParameterExceptionTest.php b/components/ILIAS/Test/tests/Exceptions/ilTestMissingSourcePoolDefinitionParameterExceptionTest.php index 52edbeb5509a..24a5b52c49df 100644 --- a/components/ILIAS/Test/tests/Exceptions/ilTestMissingSourcePoolDefinitionParameterExceptionTest.php +++ b/components/ILIAS/Test/tests/Exceptions/ilTestMissingSourcePoolDefinitionParameterExceptionTest.php @@ -32,7 +32,7 @@ public function testConstruct(array $input, array $output): void $this->assertEquals($output['code'], $ilTestMissingSourcePoolDefinitionParameterException->getCode()); } - public function constructDataProvider(): array + public static function constructDataProvider(): array { return [ [['msg' => '', 'code' => -1], ['msg' => ilTestMissingSourcePoolDefinitionParameterException::class, 'code' => -1]], @@ -60,7 +60,7 @@ public function testException(array $input, array $output): void ; } - public function exceptionDataProvider(): array + public static function exceptionDataProvider(): array { return [ [['msg' => '', 'code' => -1], ['msg' => ilTestMissingSourcePoolDefinitionParameterException::class, 'code' => -1]], @@ -73,4 +73,4 @@ public function exceptionDataProvider(): array [['msg' => 'test'], ['msg' => 'test', 'code' => 0]] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/Exceptions/ilTestNoNextRequestableHintExistsExceptionTest.php b/components/ILIAS/Test/tests/Exceptions/ilTestNoNextRequestableHintExistsExceptionTest.php index 5e2796d06f88..65c5df4ab8cc 100644 --- a/components/ILIAS/Test/tests/Exceptions/ilTestNoNextRequestableHintExistsExceptionTest.php +++ b/components/ILIAS/Test/tests/Exceptions/ilTestNoNextRequestableHintExistsExceptionTest.php @@ -32,7 +32,7 @@ public function testConstruct(array $input, array $output): void $this->assertEquals($output['code'], $ilTestNoNextRequestableHintExistsException->getCode()); } - public function constructDataProvider(): array + public static function constructDataProvider(): array { return [ [['msg' => '', 'code' => -1], ['msg' => ilTestNoNextRequestableHintExistsException::class, 'code' => -1]], @@ -60,7 +60,7 @@ public function testException(array $input, array $output): void ; } - public function exceptionDataProvider(): array + public static function exceptionDataProvider(): array { return [ [['msg' => '', 'code' => -1], ['msg' => ilTestNoNextRequestableHintExistsException::class, 'code' => -1]], @@ -73,4 +73,4 @@ public function exceptionDataProvider(): array [['msg' => 'test'], ['msg' => 'test', 'code' => 0]] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/Exceptions/ilTestQuestionPoolNotAvailableAsSourcePoolExceptionTest.php b/components/ILIAS/Test/tests/Exceptions/ilTestQuestionPoolNotAvailableAsSourcePoolExceptionTest.php index 7bc07bb93e5b..d96e2b0bea0f 100644 --- a/components/ILIAS/Test/tests/Exceptions/ilTestQuestionPoolNotAvailableAsSourcePoolExceptionTest.php +++ b/components/ILIAS/Test/tests/Exceptions/ilTestQuestionPoolNotAvailableAsSourcePoolExceptionTest.php @@ -17,6 +17,7 @@ *********************************************************************/ namespace Test\tests\exceptions; + use ilTestBaseTestCase; use ilTestQuestionPoolNotAvailableAsSourcePoolException; @@ -35,7 +36,7 @@ public function testConstruct(array $input, array $output): void $this->assertEquals($output['code'], $ilTestQuestionPoolNotAvailableAsSourcePoolException->getCode()); } - public function constructDataProvider(): array + public static function constructDataProvider(): array { return [ [['msg' => '', 'code' => -1], ['msg' => ilTestQuestionPoolNotAvailableAsSourcePoolException::class, 'code' => 0]], @@ -62,7 +63,7 @@ public function testException(array $input, array $output): void : new ilTestQuestionPoolNotAvailableAsSourcePoolException($input['msg']); } - public function exceptionDataProvider(): array + public static function exceptionDataProvider(): array { return [ [['msg' => '', 'code' => -1], ['msg' => ilTestQuestionPoolNotAvailableAsSourcePoolException::class, 'code' => 0]], @@ -75,4 +76,4 @@ public function exceptionDataProvider(): array [['msg' => 'test'], ['msg' => ilTestQuestionPoolNotAvailableAsSourcePoolException::class, 'code' => 0]] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/MainSettings/ilObjTestMainSettingsTest.php b/components/ILIAS/Test/tests/MainSettings/ilObjTestMainSettingsTest.php index 0854520302f6..cace50fd66dd 100644 --- a/components/ILIAS/Test/tests/MainSettings/ilObjTestMainSettingsTest.php +++ b/components/ILIAS/Test/tests/MainSettings/ilObjTestMainSettingsTest.php @@ -44,7 +44,7 @@ public function testThrowOnDifferentTestId(int $IO): void $this->assertNull($output); } - public function throwOnDifferentTestIdDataProvider(): array + public static function throwOnDifferentTestIdDataProvider(): array { return [ [-1], @@ -76,7 +76,7 @@ public function testThrowOnDifferentTestIdException(array $input): void self::callMethod($ilObjTestMainSettings, 'throwOnDifferentTestId', [$testSettings]); } - public function throwOnDifferentTestIdExceptionDataProvider(): array + public static function throwOnDifferentTestIdExceptionDataProvider(): array { return [ [['test_id_1' => -1, 'test_id_2' => 0]], @@ -131,7 +131,7 @@ public function testGetAndWithTestId(int $IO): void $this->assertEquals($IO, $ilObjTestMainSettings->getTestId()); } - public function getAndWithTestIdDataProvider(): array + public static function getAndWithTestIdDataProvider(): array { return [ [-1], @@ -163,7 +163,7 @@ public function testGetAndWithGeneralSettings(ilObjTestSettingsGeneral $IO): voi $this->assertEquals($IO, $ilObjTestMainSettings->getGeneralSettings()); } - public function getAndWithGeneralSettingsDataProvider(): array + public static function getAndWithGeneralSettingsDataProvider(): array { return [ [$this->createMock(ilObjTestSettingsGeneral::class)] @@ -193,7 +193,7 @@ public function testGetAndWithIntroductionSettings(ilObjTestSettingsIntroduction $this->assertEquals($IO, $ilObjTestMainSettings->getIntroductionSettings()); } - public function getAndWithIntroductionSettingsDataProvider(): array + public static function getAndWithIntroductionSettingsDataProvider(): array { return [ [$this->createMock(ilObjTestSettingsIntroduction::class)] @@ -223,7 +223,7 @@ public function testGetAndWithAccessSettings(ilObjTestSettingsAccess $IO): void $this->assertEquals($IO, $ilObjTestMainSettings->getAccessSettings()); } - public function getAndWithAccessSettingsDataProvider(): array + public static function getAndWithAccessSettingsDataProvider(): array { return [ [$this->createMock(ilObjTestSettingsAccess::class)] @@ -253,7 +253,7 @@ public function testGetAndWithTestBehaviourSettings(ilObjTestSettingsTestBehavio $this->assertEquals($IO, $ilObjTestMainSettings->getTestBehaviourSettings()); } - public function getAndWithTestBehaviourSettingsDataProvider(): array + public static function getAndWithTestBehaviourSettingsDataProvider(): array { return [ [$this->createMock(ilObjTestSettingsTestBehaviour::class)] @@ -313,7 +313,7 @@ public function testGetAndWithParticipantFunctionalitySettings(ilObjTestSettings $this->assertEquals($IO, $ilObjTestMainSettings->getParticipantFunctionalitySettings()); } - public function getAndWithParticipantFunctionalitySettingsDataProvider(): array + public static function getAndWithParticipantFunctionalitySettingsDataProvider(): array { return [ [$this->createMock(ilObjTestSettingsParticipantFunctionality::class)] @@ -343,7 +343,7 @@ public function testGetAndWithFinishingSettings(ilObjTestSettingsFinishing $IO): $this->assertEquals($IO, $ilObjTestMainSettings->getFinishingSettings()); } - public function getAndWithFinishingSettingsDataProvider(): array + public static function getAndWithFinishingSettingsDataProvider(): array { return [ [$this->createMock(ilObjTestSettingsFinishing::class)] @@ -373,7 +373,7 @@ public function testGetAndWithAdditionalSettings(ilObjTestSettingsAdditional $IO $this->assertEquals($IO, $ilObjTestMainSettings->getAdditionalSettings()); } - public function getAndWithAdditionalSettingsDataProvider(): array + public static function getAndWithAdditionalSettingsDataProvider(): array { return [ [$this->createMock(ilObjTestSettingsAdditional::class)] diff --git a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsAccessTest.php b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsAccessTest.php index 604f5f48b68a..8179caca9e86 100644 --- a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsAccessTest.php +++ b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsAccessTest.php @@ -32,7 +32,7 @@ public function testGetAndWithStartTimeEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingAccess->getStartTimeEnabled()); } - public function getAndWithStartTimeEnabledDataProvider(): array + public static function getAndWithStartTimeEnabledDataProvider(): array { return [ [true], @@ -52,7 +52,7 @@ public function testGetAndWithStartTime(?DateTimeImmutable $IO): void $this->assertEquals($IO, $ilObjTestSettingAccess->getStartTime()); } - public function getAndWithStartTimeDataProvider(): array + public static function getAndWithStartTimeDataProvider(): array { return [ [new DateTimeImmutable()], @@ -72,7 +72,7 @@ public function testGetAndWithEndTimeEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingAccess->getEndTimeEnabled()); } - public function getAndWithEndTimeEnabledDataProvider(): array + public static function getAndWithEndTimeEnabledDataProvider(): array { return [ [true], @@ -92,7 +92,7 @@ public function testGetAndWithEndTime(?DateTimeImmutable $IO): void $this->assertEquals($IO, $ilObjTestSettingAccess->getEndTime()); } - public function getAndWithEndTimeDataProvider(): array + public static function getAndWithEndTimeDataProvider(): array { return [ [new DateTimeImmutable()], @@ -112,7 +112,7 @@ public function testGetAndWithPasswordEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingAccess->getPasswordEnabled()); } - public function getAndWithPasswordEnabledDataProvider(): array + public static function getAndWithPasswordEnabledDataProvider(): array { return [ [true], @@ -132,7 +132,7 @@ public function testGetAndWithPassword(?string $IO): void $this->assertEquals($IO, $ilObjTestSettingAccess->getPassword()); } - public function getAndWithPasswordDataProvider(): array + public static function getAndWithPasswordDataProvider(): array { return [ [null], @@ -153,11 +153,11 @@ public function testGetAndWithFixedParticipants(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingAccess->getFixedParticipants()); } - public function getAndWithFixedParticipantsDataProvider(): array + public static function getAndWithFixedParticipantsDataProvider(): array { return [ [true], [false] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsAdditionalTest.php b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsAdditionalTest.php index d20a7110ee94..f170f3051617 100644 --- a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsAdditionalTest.php +++ b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsAdditionalTest.php @@ -32,7 +32,7 @@ public function testGetAndWithSkillsServiceEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsAdditional->getSkillsServiceEnabled()); } - public function getSkillsServiceEnabledDataProvider(): array + public static function getSkillsServiceEnabledDataProvider(): array { return [ [true], @@ -52,11 +52,11 @@ public function testGetAndWithHideInfoTab(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsAdditional->getHideInfoTab()); } - public function getHideInfoTabDataProvider(): array + public static function getHideInfoTabDataProvider(): array { return [ [true], [false] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsFinishingTest.php b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsFinishingTest.php index 78afced2bbad..85aff598d55a 100644 --- a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsFinishingTest.php +++ b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsFinishingTest.php @@ -32,7 +32,7 @@ public function testGetAndWithShowAnswerOverview(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsFinishing->getShowAnswerOverview()); } - public function getAndWithConcludingRemarksEnabledDataProvider(): array + public static function getAndWithConcludingRemarksEnabledDataProvider(): array { return [ [true], @@ -67,7 +67,7 @@ public function testGetAndWithConcludingRemarksText(?string $IO): void $this->assertEquals($IO, $ilObjTestSettingsFinishing->getConcludingRemarksText()); } - public function getAndWithConcludingRemarksTextDataProvider(): array + public static function getAndWithConcludingRemarksTextDataProvider(): array { return [ [null], @@ -88,7 +88,7 @@ public function testGetAndWithConcludingRemarksPageId(?int $IO): void $this->assertEquals($IO, $ilObjTestSettingsFinishing->getConcludingRemarksPageId()); } - public function getAndWithConcludingRemarksPageIdDataProvider(): array + public static function getAndWithConcludingRemarksPageIdDataProvider(): array { return [ [null], @@ -110,7 +110,7 @@ public function testGetAndWithRedirectionMode(int $IO): void $this->assertEquals($IO, $ilObjTestSettingsFinishing->getRedirectionMode()); } - public function getAndWithRedirectionModeDataProvider(): array + public static function getAndWithRedirectionModeDataProvider(): array { return [ [-1], @@ -131,7 +131,7 @@ public function testGetAndWithRedirectionUrl(?string $IO): void $this->assertEquals($IO, $ilObjTestSettingsFinishing->getRedirectionUrl()); } - public function getAndWithRedirectionUrlDataProvider(): array + public static function getAndWithRedirectionUrlDataProvider(): array { return [ [null], @@ -152,7 +152,7 @@ public function testGetAndWithMailNotificationContentType(int $IO): void $this->assertEquals($IO, $ilObjTestSettingsFinishing->getMailNotificationContentType()); } - public function getAndWithMailNotificationContentTypeDataProvider(): array + public static function getAndWithMailNotificationContentTypeDataProvider(): array { return [ [-1], @@ -173,11 +173,11 @@ public function testGetAndWithAlwaysSendMailNotification(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsFinishing->getAlwaysSendMailNotification()); } - public function getAndWithAlwaysSendMailNotificationDataProvider(): array + public static function getAndWithAlwaysSendMailNotificationDataProvider(): array { return [ [true], [false] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsGeneralTest.php b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsGeneralTest.php index 6cb8427bb911..bac8432bce63 100644 --- a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsGeneralTest.php +++ b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsGeneralTest.php @@ -32,7 +32,7 @@ public function testGetAndWithQuestionSetType(string $IO): void $this->assertEquals($IO, $ilObjTestSettingsGeneral->getQuestionSetType()); } - public function getAndWithQuestionSetTypeDataProvider(): array + public static function getAndWithQuestionSetTypeDataProvider(): array { return [ [ilObjTest::QUESTION_SET_TYPE_FIXED], @@ -52,11 +52,11 @@ public function testGetAndWithAnonymity(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsGeneral->getAnonymity()); } - public function getAndWithAnonymityDataProvider(): array + public static function getAndWithAnonymityDataProvider(): array { return [ [true], [false] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsIntroductionTest.php b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsIntroductionTest.php index 6ec7e43bd9f9..c67d3e8cebb1 100644 --- a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsIntroductionTest.php +++ b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsIntroductionTest.php @@ -32,7 +32,7 @@ public function testGetAndWithIntroductionEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsIntroduction->getIntroductionEnabled()); } - public function getAndWithIntroductionEnabledDataProvider(): array + public static function getAndWithIntroductionEnabledDataProvider(): array { return [ [true], @@ -52,7 +52,7 @@ public function testGetAndWithIntroductionText(string $IO): void $this->assertEquals($IO, $ilObjTestSettingsIntroduction->getIntroductionText()); } - public function getAndWithIntroductionTextDataProvider(): array + public static function getAndWithIntroductionTextDataProvider(): array { return [ [''], @@ -72,7 +72,7 @@ public function testGetAndWithIntroductionPageId(?int $IO): void $this->assertEquals($IO, $ilObjTestSettingsIntroduction->getIntroductionPageId()); } - public function getAndWithIntroductionPageIdDataProvider(): array + public static function getAndWithIntroductionPageIdDataProvider(): array { return [ [null], @@ -94,11 +94,11 @@ public function testGetAndWithExamConditionsCheckboxEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsIntroduction->getExamConditionsCheckboxEnabled()); } - public function getAndWithExamConditionsCheckboxEnabledDataProvider(): array + public static function getAndWithExamConditionsCheckboxEnabledDataProvider(): array { return [ [true], [false] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsParticipantFunctionalityTest.php b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsParticipantFunctionalityTest.php index 2d9a9def5b10..c16cb83b5a6c 100644 --- a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsParticipantFunctionalityTest.php +++ b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsParticipantFunctionalityTest.php @@ -32,7 +32,7 @@ public function testGetAndWithUsePreviousAnswerAllowed(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsParticipantFunctionality->getUsePreviousAnswerAllowed()); } - public function getAndWithUsePreviousAnswerAllowedDataProvider(): array + public static function getAndWithUsePreviousAnswerAllowedDataProvider(): array { return [ [true], @@ -52,7 +52,7 @@ public function testGetAndWithSuspendTestAllowed(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsParticipantFunctionality->getSuspendTestAllowed()); } - public function getAndWithSuspendTestAllowedDataProvider(): array + public static function getAndWithSuspendTestAllowedDataProvider(): array { return [ [true], @@ -72,7 +72,7 @@ public function testGetAndWithPostponedQuestionsMoveToEnd(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsParticipantFunctionality->getPostponedQuestionsMoveToEnd()); } - public function getAndWithPostponedQuestionsMoveToEndDataProvider(): array + public static function getAndWithPostponedQuestionsMoveToEndDataProvider(): array { return [ [true], @@ -92,7 +92,7 @@ public function testGetAndWithQuestionListEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsParticipantFunctionality->getQuestionListEnabled()); } - public function getAndWithQuestionListEnabledDataProvider(): array + public static function getAndWithQuestionListEnabledDataProvider(): array { return [ [true], @@ -112,7 +112,7 @@ public function testGetAndWithUsrPassOverviewMode(int $IO): void $this->assertEquals($IO, $ilObjTestSettingsParticipantFunctionality->getUsrPassOverviewMode()); } - public function getAndWithUsrPassOverviewModeDataProvider(): array + public static function getAndWithUsrPassOverviewModeDataProvider(): array { return [ [-1], @@ -133,11 +133,11 @@ public function testGetAndWithQuestionMarkingEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsParticipantFunctionality->getQuestionMarkingEnabled()); } - public function getAndWithUsrPassOverviewEnabledDataProvider(): array + public static function getAndWithUsrPassOverviewEnabledDataProvider(): array { return [ [true], [false] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsQuestionBehaviourTest.php b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsQuestionBehaviourTest.php index 52d3072ddd7e..0eed69f333a6 100644 --- a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsQuestionBehaviourTest.php +++ b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsQuestionBehaviourTest.php @@ -52,7 +52,7 @@ public function testGetAndWithQuestionTitleOutputMode(int $IO): void $this->assertEquals($IO, $ilObjTestSettingsQuestionBehaviour->getQuestionTitleOutputMode()); } - public function getAndWithQuestionTitleOutputModeDataProvider(): array + public static function getAndWithQuestionTitleOutputModeDataProvider(): array { return [ [-1], @@ -73,7 +73,7 @@ public function testGetAndWithAutosaveEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsQuestionBehaviour->getAutosaveEnabled()); } - public function getAndWithInstantFeedbackDataProvider(): array + public static function getAndWithInstantFeedbackDataProvider(): array { return [ [false], @@ -93,7 +93,7 @@ public function testGetAndWithAutosaveInterval(int $IO): void $this->assertEquals($IO, $ilObjTestSettingsQuestionBehaviour->getAutosaveInterval()); } - public function getAndWithAutosaveIntervalDataProvider(): array + public static function getAndWithAutosaveIntervalDataProvider(): array { return [ [-1], @@ -114,7 +114,7 @@ public function testGetAndWithShuffleQuestions(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsQuestionBehaviour->getShuffleQuestions()); } - public function getAndWithShuffleQuestionsDataProvider(): array + public static function getAndWithShuffleQuestionsDataProvider(): array { return [ [false], @@ -134,7 +134,7 @@ public function testGetAndWithQuestionHintsEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsQuestionBehaviour->getQuestionHintsEnabled()); } - public function getAndWithQuestionHintsEnabledDataProvider(): array + public static function getAndWithQuestionHintsEnabledDataProvider(): array { return [ [false], @@ -154,7 +154,7 @@ public function testGetAndWithInstantFeedbackPointsEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsQuestionBehaviour->getInstantFeedbackPointsEnabled()); } - public function getAndWithInstantFeedbackPointsEnabledDataProvider(): array + public static function getAndWithInstantFeedbackPointsEnabledDataProvider(): array { return [ [false], @@ -174,7 +174,7 @@ public function testGetAndWithInstantFeedbackGenericEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsQuestionBehaviour->getInstantFeedbackGenericEnabled()); } - public function getAndWithInstantFeedbackGenericEnabledDataProvider(): array + public static function getAndWithInstantFeedbackGenericEnabledDataProvider(): array { return [ [false], @@ -194,7 +194,7 @@ public function testGetAndWithInstantFeedbackSpecificEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsQuestionBehaviour->getInstantFeedbackSpecificEnabled()); } - public function getAndWithInstantFeedbackSpecificEnabledDataProvider(): array + public static function getAndWithInstantFeedbackSpecificEnabledDataProvider(): array { return [ [false], @@ -214,7 +214,7 @@ public function testGetAndWithInstantFeedbackSolutionEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsQuestionBehaviour->getInstantFeedbackSolutionEnabled()); } - public function getAndWithInstantFeedbackSolutionEnabledDataProvider(): array + public static function getAndWithInstantFeedbackSolutionEnabledDataProvider(): array { return [ [false], @@ -234,7 +234,7 @@ public function testGetAndWithForceInstantFeedbackOnNextQuestion(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsQuestionBehaviour->getForceInstantFeedbackOnNextQuestion()); } - public function getAndWithForceInstantFeedbackOnNextQuestionDataProvider(): array + public static function getAndWithForceInstantFeedbackOnNextQuestionDataProvider(): array { return [ [false], @@ -254,7 +254,7 @@ public function testGetAndWithLockAnswerOnInstantFeedbackEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsQuestionBehaviour->getLockAnswerOnInstantFeedbackEnabled()); } - public function getAndWithLockAnswerOnInstantFeedbackEnabledDataProvider(): array + public static function getAndWithLockAnswerOnInstantFeedbackEnabledDataProvider(): array { return [ [false], @@ -274,7 +274,7 @@ public function testGetAndWithLockAnswerOnNextQuestionEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsQuestionBehaviour->getLockAnswerOnNextQuestionEnabled()); } - public function getAndWithLockAnswerOnNextQuestionEnabledDataProvider(): array + public static function getAndWithLockAnswerOnNextQuestionEnabledDataProvider(): array { return [ [false], @@ -294,11 +294,11 @@ public function testGetAndWithCompulsoryQuestionsEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsQuestionBehaviour->getCompulsoryQuestionsEnabled()); } - public function getAndWithCompulsoryQuestionsEnabledDataProvider(): array + public static function getAndWithCompulsoryQuestionsEnabledDataProvider(): array { return [ [false], [true] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsTestBehaviourTest.php b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsTestBehaviourTest.php index 9735c5ec42ba..64c5110ca1d1 100644 --- a/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsTestBehaviourTest.php +++ b/components/ILIAS/Test/tests/MainSettings/ilObjTestSettingsTestBehaviourTest.php @@ -32,7 +32,7 @@ public function testGetAndWithNumberOfTries(int $IO): void $this->assertEquals($IO, $ilObjTestSettingsTestBehaviour->getNumberOfTries()); } - public function getAndWithNumberOfTriesDataProvider(): array + public static function getAndWithNumberOfTriesDataProvider(): array { return [ [-1], @@ -53,7 +53,7 @@ public function testGetAndWithBlockAfterPassedEnabled(): void $this->assertTrue($ilObjTestSettingsTestBehaviour->getBlockAfterPassedEnabled()); } - public function getAndWithBlockAfterPassedEnabledDataProvider(): array + public static function getAndWithBlockAfterPassedEnabledDataProvider(): array { return [ [true], @@ -73,7 +73,7 @@ public function testGetAndWithPassWaiting(?string $IO): void $this->assertEquals($IO, $ilObjTestSettingsTestBehaviour->getPassWaiting()); } - public function getAndWithPassWaitingDataProvider(): array + public static function getAndWithPassWaitingDataProvider(): array { return [ [null], @@ -93,7 +93,7 @@ public function testGetAndWithProcessingTimeEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsTestBehaviour->getProcessingTimeEnabled()); } - public function getAndWithProcessingTimeEnabledDataProvider(): array + public static function getAndWithProcessingTimeEnabledDataProvider(): array { return [ [true], @@ -113,7 +113,7 @@ public function testGetAndWithProcessingTime(?string $IO): void $this->assertEquals($IO, $ilObjTestSettingsTestBehaviour->getProcessingTime()); } - public function getAndWithProcessingTimeDataProvider(): array + public static function getAndWithProcessingTimeDataProvider(): array { return [ [null], @@ -134,7 +134,7 @@ public function testGetAndWithResetProcessingTime(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsTestBehaviour->getResetProcessingTime()); } - public function getAndWithResetProcessingTimeDataProvider(): array + public static function getAndWithResetProcessingTimeDataProvider(): array { return [ [true], @@ -154,7 +154,7 @@ public function testGetAndWithKioskMode(int $IO): void $this->assertEquals($IO, $ilObjTestSettingsTestBehaviour->getKioskMode()); } - public function getAndWithKioskModeDataProvider(): array + public static function getAndWithKioskModeDataProvider(): array { return [ [-1], @@ -176,7 +176,7 @@ public function testGetAndWithExamIdInTestPassEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsTestBehaviour->getExamIdInTestPassEnabled()); } - public function getAndWithExamIdInTestPassEnabledDataProvider(): array + public static function getAndWithExamIdInTestPassEnabledDataProvider(): array { return [ [true], diff --git a/components/ILIAS/Test/tests/Results/ilTestPassResultTest.php b/components/ILIAS/Test/tests/Results/ilTestPassResultTest.php index 9e3603311ef3..1c4b0e711c5a 100644 --- a/components/ILIAS/Test/tests/Results/ilTestPassResultTest.php +++ b/components/ILIAS/Test/tests/Results/ilTestPassResultTest.php @@ -39,7 +39,7 @@ public function testGetSettings(ilTestPassResultsSettings $IO): void $this->assertEquals($IO, $ilTestPassResult->getSettings()); } - public function getSettingsDataProvider(): array + public static function getSettingsDataProvider(): array { return [ [new ilTestPassResultsSettings()] @@ -60,7 +60,7 @@ public function testGetActiveId(int $IO): void $this->assertEquals($IO, $ilTestPassResult->getActiveId()); } - public function getActiveIdDataProvider(): array + public static function getActiveIdDataProvider(): array { return [ [-1], @@ -83,7 +83,7 @@ public function testGetPass(int $IO): void $this->assertEquals($IO, $ilTestPassResult->getPass()); } - public function getPassDataProvider(): array + public static function getPassDataProvider(): array { return [ [-1], @@ -106,7 +106,7 @@ public function testGetQuestionResults(array $IO): void $this->assertEquals($IO, $ilTestPassResult->getQuestionResults()); } - public function getQuestionResultsDataProvider(): array + public static function getQuestionResultsDataProvider(): array { return [ [[]], @@ -114,4 +114,4 @@ public function getQuestionResultsDataProvider(): array [[$this->createMock(ilQuestionResult::class), $this->createMock(ilQuestionResult::class)]] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsGamificationTest.php b/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsGamificationTest.php index eb0157518228..ad648705cf50 100644 --- a/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsGamificationTest.php +++ b/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsGamificationTest.php @@ -39,7 +39,7 @@ public function testGetAndWithHighscoreEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsGamification->getHighscoreEnabled()); } - public function getAndWithHighscoreEnabledDataProvider(): array + public static function getAndWithHighscoreEnabledDataProvider(): array { return [ [true], @@ -57,7 +57,7 @@ public function testGetAndWithHighscoreOwnTable(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsGamification->getHighscoreOwnTable()); } - public function getAndWithHighscoreOwnTableDataProvider(): array + public static function getAndWithHighscoreOwnTableDataProvider(): array { return [ [true], @@ -75,7 +75,7 @@ public function testGetAndWithHighscoreTopTable(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsGamification->getHighscoreTopTable()); } - public function getAndWithHighscoreTopTableDataProvider(): array + public static function getAndWithHighscoreTopTableDataProvider(): array { return [ [true], @@ -93,7 +93,7 @@ public function testGetAndWithHighscoreTopNum(int $IO): void $this->assertEquals($IO, $ilObjTestSettingsGamification->getHighscoreTopNum()); } - public function getAndWithHighscoreTopNumDataProvider(): array + public static function getAndWithHighscoreTopNumDataProvider(): array { return [ [-1], @@ -112,7 +112,7 @@ public function testGetAndWithHighscoreAnon(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsGamification->getHighscoreAnon()); } - public function getAndWithHighscoreAnonDataProvider(): array + public static function getAndWithHighscoreAnonDataProvider(): array { return [ [true], @@ -130,7 +130,7 @@ public function testGetAndWithHighscoreAchievedTS(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsGamification->getHighscoreAchievedTS()); } - public function getAndWithHighscoreAchievedTSDataProvider(): array + public static function getAndWithHighscoreAchievedTSDataProvider(): array { return [ [true], @@ -148,7 +148,7 @@ public function testGetAndWithHighscoreScore(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsGamification->getHighscoreScore()); } - public function getAndWithHighscoreScoreDataProvider(): array + public static function getAndWithHighscoreScoreDataProvider(): array { return [ [true], @@ -166,7 +166,7 @@ public function testGetAndWithHighscorePercentage(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsGamification->getHighscorePercentage()); } - public function getAndWithHighscorePercentageDataProvider(): array + public static function getAndWithHighscorePercentageDataProvider(): array { return [ [true], @@ -184,7 +184,7 @@ public function testGetAndWithHighscoreHints(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsGamification->getHighscoreHints()); } - public function getAndWithHighscoreHintsDataProvider(): array + public static function getAndWithHighscoreHintsDataProvider(): array { return [ [true], @@ -202,11 +202,11 @@ public function testGetAndWithHighscoreWTime(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsGamification->getHighscoreWTime()); } - public function getAndWithHighscoreWTimeDataProvider(): array + public static function getAndWithHighscoreWTimeDataProvider(): array { return [ [true], [false] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsResultDetailsTest.php b/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsResultDetailsTest.php index 81175f2b5a58..2f1673bc40f5 100644 --- a/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsResultDetailsTest.php +++ b/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsResultDetailsTest.php @@ -39,7 +39,7 @@ public function testGetAndWithResultsPresentation(int $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultDetails->getResultsPresentation()); } - public function getAndWithResultsPresentationDataProvider(): array + public static function getAndWithResultsPresentationDataProvider(): array { return [ [-1], @@ -58,7 +58,7 @@ public function testGetAndShowExamIdInTestResults(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultDetails->getShowExamIdInTestResults()); } - public function getAndShowExamIdInTestResultsDataProvider(): array + public static function getAndShowExamIdInTestResultsDataProvider(): array { return [ [false], @@ -76,7 +76,7 @@ public function testGetAndWithShowPassDetails(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultDetails->getShowPassDetails()); } - public function getAndWithShowPassDetailsDataProvider(): array + public static function getAndWithShowPassDetailsDataProvider(): array { return [ [false], @@ -94,7 +94,7 @@ public function testGetAndWithShowSolutionPrintview(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultDetails->getShowSolutionPrintview()); } - public function getAndWithShowSolutionPrintviewDataProvider(): array + public static function getAndWithShowSolutionPrintviewDataProvider(): array { return [ [false], @@ -112,7 +112,7 @@ public function testGetShowSolutionFeedback(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultDetails->getShowSolutionFeedback()); } - public function getAndWithShowSolutionFeedbackDataProvider(): array + public static function getAndWithShowSolutionFeedbackDataProvider(): array { return [ [false], @@ -130,7 +130,7 @@ public function testGetAndWithShowSolutionAnswersOnly(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultDetails->getShowSolutionAnswersOnly()); } - public function getAndWithShowSolutionAnswersOnlyDataProvider(): array + public static function getAndWithShowSolutionAnswersOnlyDataProvider(): array { return [ [false], @@ -148,7 +148,7 @@ public function testGetAndWithShowSolutionSignature(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultDetails->getShowSolutionSignature()); } - public function getAndWithShowSolutionSignatureDataProvider(): array + public static function getAndWithShowSolutionSignatureDataProvider(): array { return [ [false], @@ -166,7 +166,7 @@ public function testGetAndWithShowSolutionSuggested(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultDetails->getShowSolutionSuggested()); } - public function getAndWithShowSolutionSuggestedDataProvider(): array + public static function getAndWithShowSolutionSuggestedDataProvider(): array { return [ [false], @@ -184,7 +184,7 @@ public function testGetAndWithShowSolutionListComparison(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultDetails->getShowSolutionListComparison()); } - public function getAndWithShowSolutionListComparisonDataProvider(): array + public static function getAndWithShowSolutionListComparisonDataProvider(): array { return [ [false], @@ -202,7 +202,7 @@ public function testGetAndWithExportSettings(int $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultDetails->getExportSettings()); } - public function getAndWithExportSettingsDataProvider(): array + public static function getAndWithExportSettingsDataProvider(): array { return [ [-1], @@ -210,4 +210,4 @@ public function getAndWithExportSettingsDataProvider(): array [1] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsResultSummaryTest.php b/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsResultSummaryTest.php index 748c3c66cf8f..7e4fa6dcbce6 100644 --- a/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsResultSummaryTest.php +++ b/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsResultSummaryTest.php @@ -40,7 +40,7 @@ public function testGetAndWithScoreReporting(int $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultSummary->getScoreReporting()); } - public function getAndWithScoreReportingDataProvider(): array + public static function getAndWithScoreReportingDataProvider(): array { return [ [-1], @@ -59,7 +59,7 @@ public function testGetScoreReportingEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultSummary->getScoreReportingEnabled()); } - public function getScoreReportingEnabledDataProvider(): array + public static function getScoreReportingEnabledDataProvider(): array { return [ [false], @@ -77,7 +77,7 @@ public function testGetAndWithReportingDate(?\DateTimeImmutable $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultSummary->getReportingDate()); } - public function getAndWithReportingDateDataProvider(): array + public static function getAndWithReportingDateDataProvider(): array { return [ [null], @@ -95,7 +95,7 @@ public function testGetAndWithShowGradingStatusEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultSummary->getShowGradingStatusEnabled()); } - public function getAndWithShowGradingStatusEnabledDataProvider(): array + public static function getAndWithShowGradingStatusEnabledDataProvider(): array { return [ [false], @@ -113,7 +113,7 @@ public function testGetAndWithShowGradingMarkEnabled(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultSummary->getShowGradingMarkEnabled()); } - public function getAndWithShowGradingMarkEnabledDataProvider(): array + public static function getAndWithShowGradingMarkEnabledDataProvider(): array { return [ [false], @@ -131,7 +131,7 @@ public function testGetAndWithPassDeletionAllowed(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultSummary->getPassDeletionAllowed()); } - public function getAndWithPassDeletionAllowedDataProvider(): array + public static function getAndWithPassDeletionAllowedDataProvider(): array { return [ [false], @@ -149,11 +149,11 @@ public function testGetAndWithShowPassDetails(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsResultSummary->getShowPassDetails()); } - public function getAndWithShowPassDetailsDataProvider(): array + public static function getAndWithShowPassDetailsDataProvider(): array { return [ [false], [true] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsScoringTest.php b/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsScoringTest.php index 5033317e9c8a..3266f161afc8 100644 --- a/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsScoringTest.php +++ b/components/ILIAS/Test/tests/ScoreReporting/ilObjTestSettingsScoringTest.php @@ -39,7 +39,7 @@ public function testGetAndWithCountSystem(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsScoring->getCountSystem()); } - public function getAndWithCountSystemDataProvider(): array + public static function getAndWithCountSystemDataProvider(): array { return [ [true], @@ -57,7 +57,7 @@ public function testGetAndWithScoreCutting(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsScoring->getScoreCutting()); } - public function getAndWithScoreCuttingDataProvider(): array + public static function getAndWithScoreCuttingDataProvider(): array { return [ [true], @@ -75,11 +75,11 @@ public function testGetAndWithPassScoring(bool $IO): void $this->assertEquals($IO, $ilObjTestSettingsScoring->getPassScoring()); } - public function getAndWithPassScoringDataProvider(): array + public static function getAndWithPassScoringDataProvider(): array { return [ [true], [false] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/ilObjTestListGUITest.php b/components/ILIAS/Test/tests/ilObjTestListGUITest.php index 73a352882aba..92ed948b359d 100644 --- a/components/ILIAS/Test/tests/ilObjTestListGUITest.php +++ b/components/ILIAS/Test/tests/ilObjTestListGUITest.php @@ -49,7 +49,7 @@ public function testCreateDefaultCommand(array $IO): void $this->assertEquals($IO, $this->testObj->createDefaultCommand($IO)); } - public function createDefaultCommandDataProvider() + public static function createDefaultCommandDataProvider() { return [ [[]], @@ -58,4 +58,4 @@ public function createDefaultCommandDataProvider() [[1, 2, 3]] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/ilTestLPTest.php b/components/ILIAS/Test/tests/ilTestLPTest.php index 619c4f730c4a..7c293cabf721 100644 --- a/components/ILIAS/Test/tests/ilTestLPTest.php +++ b/components/ILIAS/Test/tests/ilTestLPTest.php @@ -32,7 +32,7 @@ public function testGetDefaultModes(bool $input, array $output): void $this->assertEquals($output, ilTestLP::getDefaultModes($input)); } - public function getDefaultModesDataProvider(): array + public static function getDefaultModesDataProvider(): array { return [ [true, [ilLPObjSettings::LP_MODE_DEACTIVATED, ilLPObjSettings::LP_MODE_TEST_FINISHED, ilLPObjSettings::LP_MODE_TEST_PASSED]], @@ -51,4 +51,4 @@ public function testGetValidModes(): void $ilTestLP = new ilTestLP(0); $this->assertEquals([ilLPObjSettings::LP_MODE_DEACTIVATED, ilLPObjSettings::LP_MODE_TEST_FINISHED, ilLPObjSettings::LP_MODE_TEST_PASSED], $ilTestLP->getValidModes()); } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/ilTestQuestionPoolSelectorExplorerTest.php b/components/ILIAS/Test/tests/ilTestQuestionPoolSelectorExplorerTest.php index 5df96c6e8d63..69382a16a3c0 100644 --- a/components/ILIAS/Test/tests/ilTestQuestionPoolSelectorExplorerTest.php +++ b/components/ILIAS/Test/tests/ilTestQuestionPoolSelectorExplorerTest.php @@ -17,6 +17,7 @@ *********************************************************************/ namespace Test\tests; + use ilObjectDataCache; use ilRepositorySelectorExplorerGUI; use ilTestBaseTestCase; @@ -58,7 +59,7 @@ public function testGetAndSetAvailableQuestionPools(array $IO): void $this->assertEquals($IO, $this->testObj->getAvailableQuestionPools()); } - public function getAndSetAvailableQuestionPoolsDataProvider(): array + public static function getAndSetAvailableQuestionPoolsDataProvider(): array { return [ [[]], @@ -67,4 +68,4 @@ public function getAndSetAvailableQuestionPoolsDataProvider(): array [[1, 2, 3]] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/Test/tests/ilTestServiceGUITest.php b/components/ILIAS/Test/tests/ilTestServiceGUITest.php index f24d251bcd46..ca9c244a1e58 100755 --- a/components/ILIAS/Test/tests/ilTestServiceGUITest.php +++ b/components/ILIAS/Test/tests/ilTestServiceGUITest.php @@ -100,7 +100,7 @@ public function testBuildFixedShufflerSeed(int $question_id, int $pass_id, int $ $this->assertEquals($return, $method->invoke($ilTestShuffler, $question_id, $pass_id, $active_id)); } - public function buildFixedShufflerSeedDataProvider(): array + public static function buildFixedShufflerSeedDataProvider(): array { return [ [ @@ -129,4 +129,4 @@ public function buildFixedShufflerSeedDataProvider(): array ] ]; } -} \ No newline at end of file +} diff --git a/components/ILIAS/TestQuestionPool/tests/assFormulaQuestionTest.php b/components/ILIAS/TestQuestionPool/tests/assFormulaQuestionTest.php index c0d05c9e6cb3..f41a9adf99e1 100755 --- a/components/ILIAS/TestQuestionPool/tests/assFormulaQuestionTest.php +++ b/components/ILIAS/TestQuestionPool/tests/assFormulaQuestionTest.php @@ -63,7 +63,7 @@ public function testSimpleRatedFormulaQuestionCalculations( $this->assertEquals($expectedResult, $isCorrect); } - public function simpleRatedCalculationsData(): array + public static function simpleRatedCalculationsData(): array { global $DIC; diff --git a/components/ILIAS/TestQuestionPool/tests/ilAssQuestionSkillAssignmentRegistryTest.php b/components/ILIAS/TestQuestionPool/tests/ilAssQuestionSkillAssignmentRegistryTest.php index 2530dc50b16c..4303e7d88dc3 100755 --- a/components/ILIAS/TestQuestionPool/tests/ilAssQuestionSkillAssignmentRegistryTest.php +++ b/components/ILIAS/TestQuestionPool/tests/ilAssQuestionSkillAssignmentRegistryTest.php @@ -141,7 +141,7 @@ protected function getTestData(callable $pre, callable $post): array /** * @return array */ - public function serializedData(): array + public static function serializedData(): array { $pre = function ($value) { return serialize($value); diff --git a/components/ILIAS/UI/tests/AbstractFactoryTest.php b/components/ILIAS/UI/tests/AbstractFactoryTest.php index 4a5797e98b99..25d7dfff7251 100755 --- a/components/ILIAS/UI/tests/AbstractFactoryTest.php +++ b/components/ILIAS/UI/tests/AbstractFactoryTest.php @@ -102,7 +102,7 @@ final public function buildFactoryReflection(): ReflectionClass return new ReflectionClass($this->factory_title); } - final public function getMethodsProvider(): array + final public static function getMethodsProvider(): array { $reflection = $this->buildFactoryReflection(); return array_filter( diff --git a/components/ILIAS/UI/tests/Component/Button/ButtonTest.php b/components/ILIAS/UI/tests/Component/Button/ButtonTest.php index 4264d05f264b..c10dd57a77cd 100755 --- a/components/ILIAS/UI/tests/Component/Button/ButtonTest.php +++ b/components/ILIAS/UI/tests/Component/Button/ButtonTest.php @@ -570,7 +570,7 @@ public function testFactoryAcceptsSignalAsAction(string $factory_method): void $this->assertEquals([$signal], $button->getAction()); } - public function getButtonTypeProvider(): array + public static function getButtonTypeProvider(): array { return [ ['standard'], diff --git a/components/ILIAS/UI/tests/Component/Counter/CounterTest.php b/components/ILIAS/UI/tests/Component/Counter/CounterTest.php index 2877450f7830..7a98f33f1620 100755 --- a/components/ILIAS/UI/tests/Component/Counter/CounterTest.php +++ b/components/ILIAS/UI/tests/Component/Counter/CounterTest.php @@ -89,7 +89,7 @@ public function testIntNumbersOnly($no_number): void $f->status($no_number); } - public function getNumberProvider(): array + public static function getNumberProvider(): array { return [ [-13], @@ -99,7 +99,7 @@ public function getNumberProvider(): array ]; } - public function getNoNumberProvider(): array + public static function getNoNumberProvider(): array { return [ ["foo"], @@ -130,7 +130,7 @@ public function testRenderStatus(string $type, int $number): void $this->assertHTMLEquals($expected, $html); } - public function getCounterTypeAndNumberProvider(): array + public static function getCounterTypeAndNumberProvider(): array { return [ ["status", 42], diff --git a/components/ILIAS/UI/tests/Component/Entity/EntityTest.php b/components/ILIAS/UI/tests/Component/Entity/EntityTest.php index a15b66189f0a..676091f33999 100755 --- a/components/ILIAS/UI/tests/Component/Entity/EntityTest.php +++ b/components/ILIAS/UI/tests/Component/Entity/EntityTest.php @@ -60,7 +60,7 @@ public function testEntityBasicProperties(): void $this->assertEquals([$this->legacy('d')], $entity->withDetails($this->legacy('d'))->getDetails()); } - public function getEntityAllowedIdentiferTypes(): array + public static function getEntityAllowedIdentiferTypes(): array { $shy_button = new Button\Shy('the label', '#'); $shy_link = new Link\Standard('the label', '#'); diff --git a/components/ILIAS/UI/tests/Component/MessageBox/MessageBoxTest.php b/components/ILIAS/UI/tests/Component/MessageBox/MessageBoxTest.php index 4a8375b2b220..5532b3be52c3 100755 --- a/components/ILIAS/UI/tests/Component/MessageBox/MessageBoxTest.php +++ b/components/ILIAS/UI/tests/Component/MessageBox/MessageBoxTest.php @@ -42,7 +42,7 @@ public function getLinkFactory(): IC\Link\Factory return new IC\Link\Factory(); } - public function getMessageboxTypeProvider(): array + public static function getMessageboxTypeProvider(): array { return array( array(C\MessageBox\MessageBox::FAILURE) , array(C\MessageBox\MessageBox::SUCCESS) diff --git a/components/ILIAS/UI/tests/Component/Modal/LightboxTest.php b/components/ILIAS/UI/tests/Component/Modal/LightboxTest.php index 55571bc9d502..7deeeabb1cde 100755 --- a/components/ILIAS/UI/tests/Component/Modal/LightboxTest.php +++ b/components/ILIAS/UI/tests/Component/Modal/LightboxTest.php @@ -55,7 +55,7 @@ public function testSimplePageRendering(string $method, array $args, string $exp $this->assertEquals($expected, $actual); } - public function getPageProvider(): array + public static function getPageProvider(): array { $image = new I\Component\Image\Image("responsive", 'src/fake/image.jpg', 'description'); $card = new I\Component\Card\Card('foo'); diff --git a/components/ILIAS/UI/tests/Component/Symbol/Glyph/GlyphTest.php b/components/ILIAS/UI/tests/Component/Symbol/Glyph/GlyphTest.php index e2e6b7103d34..89c65ffb1b42 100755 --- a/components/ILIAS/UI/tests/Component/Symbol/Glyph/GlyphTest.php +++ b/components/ILIAS/UI/tests/Component/Symbol/Glyph/GlyphTest.php @@ -331,7 +331,7 @@ public function testKnownGlyphsOnly(): void new Glyph("FOO", "http://www.ilias.de"); } - public function getGlyphTypeProvider(): array + public static function getGlyphTypeProvider(): array { $glyph_reflection = new ReflectionClass(G\Glyph::class); $constant_values = array_values($glyph_reflection->getConstants()); @@ -340,7 +340,7 @@ public function getGlyphTypeProvider(): array }, $constant_values); } - public function getCounterTypeProvider(): array + public static function getCounterTypeProvider(): array { return [ ["status"], diff --git a/components/ILIAS/UI/tests/Component/Table/Column/ColumnFactoryTest.php b/components/ILIAS/UI/tests/Component/Table/Column/ColumnFactoryTest.php index 2e7de9c5a239..5b8410b52504 100755 --- a/components/ILIAS/UI/tests/Component/Table/Column/ColumnFactoryTest.php +++ b/components/ILIAS/UI/tests/Component/Table/Column/ColumnFactoryTest.php @@ -53,7 +53,7 @@ protected function buildFactories() ]; } - public function getColumnTypeProvider(): array + public static function getColumnTypeProvider(): array { list($f, $df) = $this->buildFactories(); $date_format = $df->dateFormat()->germanShort(); diff --git a/components/ILIAS/UI/tests/Component/Toast/ToastTest.php b/components/ILIAS/UI/tests/Component/Toast/ToastTest.php index 526cbe13e7ab..efc3a6740991 100755 --- a/components/ILIAS/UI/tests/Component/Toast/ToastTest.php +++ b/components/ILIAS/UI/tests/Component/Toast/ToastTest.php @@ -91,7 +91,7 @@ public function testToastContainer(string $title, string $description, int $vani $this->assertCount(0, $container->withoutToasts()->getToasts()); } - public function getToastProvider(): array + public static function getToastProvider(): array { return [ ['title', 'description', 5000, 500, 'test.php'], diff --git a/components/ILIAS/UI/tests/Examples/ExamplesTest.php b/components/ILIAS/UI/tests/Examples/ExamplesTest.php index d08ab7921cae..164163196ed0 100755 --- a/components/ILIAS/UI/tests/Examples/ExamplesTest.php +++ b/components/ILIAS/UI/tests/Examples/ExamplesTest.php @@ -143,7 +143,7 @@ protected function getEntriesFromCrawler(): Crawler\Entry\ComponentEntries return $crawler->crawlFactory($this->path_to_base_factory); } - public function getFullFunctionNamesAndPathExample(): array + public static function getFullFunctionNamesAndPathExample(): array { $function_names = []; foreach ($this->getEntriesFromCrawler() as $entry) { @@ -173,7 +173,7 @@ public function testFullscreenModeExamples(string $example_function_name, string } } - public function getListOfFullscreenExamples(): array + public static function getListOfFullscreenExamples(): array { return [ ['ILIAS\UI\examples\MainControls\Footer\renderFooterInFullscreenMode', "components/ILIAS/UI/src/examples/MainControls/Footer/footer.php"], diff --git a/components/ILIAS/UI/tests/Renderer/DefaultRendererTest.php b/components/ILIAS/UI/tests/Renderer/DefaultRendererTest.php index b58641ca7cfc..b02f2585cb05 100755 --- a/components/ILIAS/UI/tests/Renderer/DefaultRendererTest.php +++ b/components/ILIAS/UI/tests/Renderer/DefaultRendererTest.php @@ -233,7 +233,7 @@ protected function getJSCodeForAsyncRenderingFor(C\Component $component) $renderer->$render_type($component, $root); } - public function getRenderType() + public static function getRenderType() { return [ ["render"], diff --git a/components/ILIAS/UICore/tests/Structure/ilCtrlStructureTest.php b/components/ILIAS/UICore/tests/Structure/ilCtrlStructureTest.php index d99368f8601a..fcc43109d348 100755 --- a/components/ILIAS/UICore/tests/Structure/ilCtrlStructureTest.php +++ b/components/ILIAS/UICore/tests/Structure/ilCtrlStructureTest.php @@ -227,7 +227,7 @@ public function testStructureReturnTargets(): void $this->assertNull($structure->getReturnTargetByClass('Class2')); } - public function getProtectedParameters(): array + public static function getProtectedParameters(): array { return [ ['baseClass'], diff --git a/components/ILIAS/Utilities/tests/ilUtilTest.php b/components/ILIAS/Utilities/tests/ilUtilTest.php index 287279fbd996..336f2d089c83 100755 --- a/components/ILIAS/Utilities/tests/ilUtilTest.php +++ b/components/ILIAS/Utilities/tests/ilUtilTest.php @@ -46,8 +46,8 @@ public function testMakeClickableWithoutGotoLinks(): void */ public function testMakeClickableWithGotoLinksAndInvalidRefId(string $expected, string $input, array $ref_to_obj, array $obj_to_title): void { - $wrap_array = static fn (array $array): array => ( - array_map(static fn (int $x): array => [$x], $array) + $wrap_array = static fn(array $array): array => ( + array_map(static fn(int $x): array => [$x], $array) ); $container = $this->mockClickableCall($input, $expected); @@ -73,7 +73,7 @@ public function testMakeClickableWithGotoLinksAndInvalidRefId(string $expected, unset($GLOBALS['DIC']); } - public function provideGotoLinkData(): array + public static function provideGotoLinkData(): array { // Please note that these test cases represent the current state, not necessarily the correct state. // For example all anchor attributes are REMOVED and the target is ALWAYS set to target="_self".