diff --git a/Tests/Unit/Domain/Model/Dto/DateDemandFactoryTest.php b/Tests/Unit/Domain/Model/Dto/DateDemandFactoryTest.php index a02cf6d4..1a5ee438 100644 --- a/Tests/Unit/Domain/Model/Dto/DateDemandFactoryTest.php +++ b/Tests/Unit/Domain/Model/Dto/DateDemandFactoryTest.php @@ -37,7 +37,7 @@ class DateDemandFactoryTest extends TestCase #[Test] public function canBeCreated(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -52,7 +52,7 @@ public function canBeCreated(): void #[Test] public function fromSettingsDoesNotThrowUndefinedArrayKeyWarnings(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -69,7 +69,7 @@ public function fromSettingsDoesNotThrowUndefinedArrayKeyWarnings(): void #[Test] public function searchWordIsSetByRequest(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -91,7 +91,7 @@ public function searchWordIsSetByRequest(): void #[Test] public function synonymsAreSetBySettings(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -130,7 +130,7 @@ public function synonymsAreSetBySettings(): void #[Test] public function categoriesAreSetByRequest(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -157,7 +157,7 @@ public function categoriesAreSetByRequest(): void #[Test] public function featuresAreSetByRequest(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -184,7 +184,7 @@ public function featuresAreSetByRequest(): void #[Test] public function regionIsSetByRequest(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -212,7 +212,7 @@ public function regionIsSetByRequest(): void #[Test] public function regionsAreSetByRequest(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -243,7 +243,7 @@ public function regionsAreSetByRequest(): void #[Test] public function startIsSetByRequest(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -273,7 +273,7 @@ public function startIsSetByRequest(): void #[Test] public function endIsSetByRequest(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -306,7 +306,7 @@ public function returnsEndsOnSameDayIfAnyIsNull( string $start, string $end ): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -344,7 +344,7 @@ public static function possibleEndAndStartNullCombinations(): Generator #[Test] public function returnsEndsOnSameDayIfBothAreOnSameDay(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -366,7 +366,7 @@ public function returnsEndsOnSameDayIfBothAreOnSameDay(): void #[Test] public function returnsEndsOnSameDayIfBothAreOnDifferentDays(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -389,7 +389,7 @@ public function returnsEndsOnSameDayIfBothAreOnDifferentDays(): void #[Test] public function returnsHighlightIfSet(mixed $highlight): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -416,7 +416,7 @@ public static function possibleSubmittedHighlights(): Generator #[Test] public function returnsNoHighlightIfNotSet(mixed $highlight): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -443,7 +443,7 @@ public static function possibleSubmittedFalsyHighlights(): Generator #[Test] public function returnsOrganizersFromSettings(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService @@ -458,7 +458,7 @@ public function returnsOrganizersFromSettings(): void #[Test] public function returnsOrganizersFromRequest(): void { - $typoScriptService = $this->createStub(TypoScriptService::class); + $typoScriptService = self::createStub(TypoScriptService::class); $subject = new DateDemandFactory( $typoScriptService diff --git a/Tests/Unit/Domain/Model/EventTest.php b/Tests/Unit/Domain/Model/EventTest.php index 589da438..b2e41251 100644 --- a/Tests/Unit/Domain/Model/EventTest.php +++ b/Tests/Unit/Domain/Model/EventTest.php @@ -26,9 +26,9 @@ public function canBeCreated(): void #[Test] public function returnsSortedFeatures(): void { - $feature1 = $this->createStub(Category::class); + $feature1 = self::createStub(Category::class); $feature1->method('getSorting')->willReturn(10); - $feature2 = $this->createStub(Category::class); + $feature2 = self::createStub(Category::class); $feature2->method('getSorting')->willReturn(5); $storage = new ObjectStorage(); diff --git a/Tests/Unit/Domain/Model/ImportTest.php b/Tests/Unit/Domain/Model/ImportTest.php index 9662310f..b42df13c 100644 --- a/Tests/Unit/Domain/Model/ImportTest.php +++ b/Tests/Unit/Domain/Model/ImportTest.php @@ -16,7 +16,7 @@ class ImportTest extends TestCase #[Test] public function canBeCreated(): void { - $folder = $this->createStub(Folder::class); + $folder = self::createStub(Folder::class); $subject = new Import( $folder, @@ -34,7 +34,7 @@ public function canBeCreated(): void #[Test] public function returnsRestExperience(): void { - $folder = $this->createStub(Folder::class); + $folder = self::createStub(Folder::class); $subject = new Import( $folder, @@ -52,7 +52,7 @@ public function returnsRestExperience(): void #[Test] public function returnsStoragePid(): void { - $folder = $this->createStub(Folder::class); + $folder = self::createStub(Folder::class); $subject = new Import( $folder, @@ -70,8 +70,8 @@ public function returnsStoragePid(): void #[Test] public function returnsRegion(): void { - $folder = $this->createStub(Folder::class); - $region = $this->createStub(Region::class); + $folder = self::createStub(Folder::class); + $region = self::createStub(Region::class); $subject = new Import( $folder, @@ -97,7 +97,7 @@ public function returnsRegion(): void #[Test] public function returnsFilesFolder(): void { - $folder = $this->createStub(Folder::class); + $folder = self::createStub(Folder::class); $subject = new Import( $folder, @@ -115,7 +115,7 @@ public function returnsFilesFolder(): void #[Test] public function returnsCategoriesPid(): void { - $folder = $this->createStub(Folder::class); + $folder = self::createStub(Folder::class); $subject = new Import( $folder, @@ -137,8 +137,8 @@ public function returnsCategoriesPid(): void #[Test] public function returnsCategoryParent(): void { - $category = $this->createStub(Category::class); - $folder = $this->createStub(Folder::class); + $category = self::createStub(Category::class); + $folder = self::createStub(Folder::class); $subject = new Import( $folder, @@ -161,7 +161,7 @@ public function returnsCategoryParent(): void #[Test] public function returnsFeaturesPid(): void { - $folder = $this->createStub(Folder::class); + $folder = self::createStub(Folder::class); $subject = new Import( $folder, @@ -185,8 +185,8 @@ public function returnsFeaturesPid(): void #[Test] public function returnsFeaturesParent(): void { - $feature = $this->createStub(Category::class); - $folder = $this->createStub(Folder::class); + $feature = self::createStub(Category::class); + $folder = self::createStub(Folder::class); $subject = new Import( $folder, @@ -211,7 +211,7 @@ public function returnsFeaturesParent(): void #[Test] public function returnsSearchQuery(): void { - $folder = $this->createStub(Folder::class); + $folder = self::createStub(Folder::class); $subject = new Import( $folder, diff --git a/Tests/Unit/Events/Controller/DateListVariablesTest.php b/Tests/Unit/Events/Controller/DateListVariablesTest.php index 89ccecb5..87a2a6e0 100644 --- a/Tests/Unit/Events/Controller/DateListVariablesTest.php +++ b/Tests/Unit/Events/Controller/DateListVariablesTest.php @@ -19,8 +19,8 @@ public function canBeCreated(): void $subject = new DateListVariables( [], new DateDemand(), - $this->createStub(QueryResult::class), - $this->createStub(PaginationInterface::class) + self::createStub(QueryResult::class), + self::createStub(PaginationInterface::class) ); self::assertInstanceOf( @@ -37,8 +37,8 @@ public function returnsInitialSearch(): void 'executed' => '1', ], new DateDemand(), - $this->createStub(QueryResult::class), - $this->createStub(PaginationInterface::class) + self::createStub(QueryResult::class), + self::createStub(PaginationInterface::class) ); self::assertSame( @@ -57,8 +57,8 @@ public function returnsInitialDemand(): void [ ], $demand, - $this->createStub(QueryResult::class), - $this->createStub(PaginationInterface::class) + self::createStub(QueryResult::class), + self::createStub(PaginationInterface::class) ); self::assertSame( @@ -70,13 +70,13 @@ public function returnsInitialDemand(): void #[Test] public function returnsInitialDates(): void { - $dates = $this->createStub(QueryResult::class); + $dates = self::createStub(QueryResult::class); $subject = new DateListVariables( [ ], new DateDemand(), $dates, - $this->createStub(PaginationInterface::class) + self::createStub(PaginationInterface::class) ); self::assertSame( @@ -89,8 +89,8 @@ public function returnsInitialDates(): void public function returnsInitialVariablesForView(): void { $demand = new DateDemand(); - $dates = $this->createStub(QueryResult::class); - $pagination = $this->createStub(PaginationInterface::class); + $dates = self::createStub(QueryResult::class); + $pagination = self::createStub(PaginationInterface::class); $subject = new DateListVariables( [ 'executed' => '1', @@ -117,8 +117,8 @@ public function returnsInitialVariablesForView(): void public function returnsVariablesForViewWithAddedVariables(): void { $demand = new DateDemand(); - $dates = $this->createStub(QueryResult::class); - $pagination = $this->createStub(PaginationInterface::class); + $dates = self::createStub(QueryResult::class); + $pagination = self::createStub(PaginationInterface::class); $subject = new DateListVariables( [ 'executed' => '1', @@ -150,8 +150,8 @@ public function returnsVariablesForViewWithAddedVariables(): void public function returnsVariablesForViewWithOverwrittenVariables(): void { $demand = new DateDemand(); - $dates = $this->createStub(QueryResult::class); - $pagination = $this->createStub(PaginationInterface::class); + $dates = self::createStub(QueryResult::class); + $pagination = self::createStub(PaginationInterface::class); $subject = new DateListVariables( [ 'executed' => '1', diff --git a/Tests/Unit/Events/Controller/DateSearchVariablesTest.php b/Tests/Unit/Events/Controller/DateSearchVariablesTest.php index cd82f1fc..b61adc48 100644 --- a/Tests/Unit/Events/Controller/DateSearchVariablesTest.php +++ b/Tests/Unit/Events/Controller/DateSearchVariablesTest.php @@ -21,7 +21,7 @@ public function canBeCreated(): void [ ], new DateDemand(), - $this->createStub(QueryResult::class), + self::createStub(QueryResult::class), [], [] ); @@ -42,7 +42,7 @@ public function returnsInitializeSettings(): void [ ], new DateDemand(), - $this->createStub(QueryResult::class), + self::createStub(QueryResult::class), [], [] ); @@ -65,7 +65,7 @@ public function returnsInitializeSearch(): void 'executed' => '1', ], new DateDemand(), - $this->createStub(QueryResult::class), + self::createStub(QueryResult::class), [], [] ); @@ -88,7 +88,7 @@ public function returnsInitializeDemand(): void [ ], $demand, - $this->createStub(QueryResult::class), + self::createStub(QueryResult::class), [], [] ); @@ -102,7 +102,7 @@ public function returnsInitializeDemand(): void #[Test] public function returnsInitialRegions(): void { - $regions = $this->createStub(QueryResult::class); + $regions = self::createStub(QueryResult::class); $subject = new DateSearchVariables( [ ], @@ -129,7 +129,7 @@ public function returnsInitialCategories(): void [ ], new DateDemand(), - $this->createStub(QueryResult::class), + self::createStub(QueryResult::class), [ ['example category'], ], @@ -153,7 +153,7 @@ public function returnsInitialFeatures(): void [ ], new DateDemand(), - $this->createStub(QueryResult::class), + self::createStub(QueryResult::class), [ ], [ @@ -173,7 +173,7 @@ public function returnsInitialFeatures(): void public function returnsInitialVariablesForView(): void { $demand = new DateDemand(); - $regions = $this->createStub(QueryResult::class); + $regions = self::createStub(QueryResult::class); $subject = new DateSearchVariables( [ ], @@ -212,7 +212,7 @@ public function returnsInitialVariablesForView(): void public function returnsVariablesForViewWithAddedVariables(): void { $demand = new DateDemand(); - $regions = $this->createStub(QueryResult::class); + $regions = self::createStub(QueryResult::class); $subject = new DateSearchVariables( [ ], @@ -256,7 +256,7 @@ public function returnsVariablesForViewWithAddedVariables(): void public function returnsVariablesForViewWithOverwrittenVariables(): void { $demand = new DateDemand(); - $regions = $this->createStub(QueryResult::class); + $regions = self::createStub(QueryResult::class); $subject = new DateSearchVariables( [ ], diff --git a/Tests/Unit/Service/DestinationDataImportService/DatesFactoryTest.php b/Tests/Unit/Service/DestinationDataImportService/DatesFactoryTest.php index 86088810..e2ac7e2c 100644 --- a/Tests/Unit/Service/DestinationDataImportService/DatesFactoryTest.php +++ b/Tests/Unit/Service/DestinationDataImportService/DatesFactoryTest.php @@ -22,8 +22,8 @@ class DatesFactoryTest extends TestCase private function createTestSubject( string $contextDate ): DatesFactory { - $logger = $this->createStub(Logger::class); - $logManager = $this->createStub(LogManager::class); + $logger = self::createStub(Logger::class); + $logManager = self::createStub(LogManager::class); $logManager->method('getLogger')->willReturn($logger); return new DatesFactory( @@ -49,7 +49,7 @@ public function returnsNoResultOnUnkownInput(array $unkownInput): void { $subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin'); - $result = $subject->createDates($this->createStub(Import::class), $unkownInput, false); + $result = $subject->createDates(self::createStub(Import::class), $unkownInput, false); self::assertInstanceOf(Generator::class, $result); self::assertCount(0, iterator_to_array($result)); @@ -75,7 +75,7 @@ public function returnsSingleNotCanceledDate(): void { $subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin'); - $result = $subject->createDates($this->createStub(Import::class), [[ + $result = $subject->createDates(self::createStub(Import::class), [[ 'start' => '2022-04-01T16:00:00+02:00', 'end' => '2022-04-01T17:00:00+02:00', 'tz' => 'Europe/Berlin', @@ -97,7 +97,7 @@ public function returnsSingleNotCanceledDate(): void #[Test] public function returnsWeeklyWithConfiguredRepeat(): void { - $import = $this->createStub(Import::class); + $import = self::createStub(Import::class); $import->method('getRepeatUntil')->willReturn('+60 days'); $subject = $this->createTestSubject('2023-01-01T13:17:24 Europe/Berlin'); @@ -124,7 +124,7 @@ public function returnsSingleCanceledDate(): void { $subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin'); - $result = $subject->createDates($this->createStub(Import::class), [[ + $result = $subject->createDates(self::createStub(Import::class), [[ 'start' => '2022-04-01T16:00:00+02:00', 'end' => '2022-04-01T17:00:00+02:00', 'tz' => 'Europe/Berlin', @@ -148,7 +148,7 @@ public function returnsCanceledDatesOnDailyBasis(): void { $subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin'); - $result = $subject->createDates($this->createStub(Import::class), [[ + $result = $subject->createDates(self::createStub(Import::class), [[ 'start' => '2022-10-29T16:00:00+02:00', 'end' => '2022-10-29T17:00:00+02:00', 'repeatUntil' => '2022-11-02T17:00:00+01:00', @@ -177,7 +177,7 @@ public function returnsNotCanceledDatesOnDailyBasis(): void { $subject = $this->createTestSubject('2022-08-29T13:17:24 Europe/Berlin'); - $result = $subject->createDates($this->createStub(Import::class), [[ + $result = $subject->createDates(self::createStub(Import::class), [[ 'start' => '2022-10-29T16:00:00+02:00', 'end' => '2022-10-29T17:00:00+02:00', 'repeatUntil' => '2022-11-02T17:00:00+01:00', @@ -206,7 +206,7 @@ public function returnsCanceledDatesOnWeeklyBasis(): void { $subject = $this->createTestSubject('2022-08-29T13:17:24 Europe/Berlin'); - $result = $subject->createDates($this->createStub(Import::class), [[ + $result = $subject->createDates(self::createStub(Import::class), [[ 'weekdays' => [ 'Saturday', 'Sunday', @@ -247,7 +247,7 @@ public function returnsNotCanceledDatesOnWeeklyBasis(): void { $subject = $this->createTestSubject('2022-08-29T13:17:24 Europe/Berlin'); - $result = $subject->createDates($this->createStub(Import::class), [[ + $result = $subject->createDates(self::createStub(Import::class), [[ 'weekdays' => [ 'Saturday', 'Sunday', @@ -288,7 +288,7 @@ public function returnsCanceledDatesOnMixedIntervals(): void { $subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin'); - $result = $subject->createDates($this->createStub(Import::class), [ + $result = $subject->createDates(self::createStub(Import::class), [ [ 'start' => '2022-06-21T16:00:00+02:00', 'end' => '2022-06-21T22:00:00+02:00', @@ -333,7 +333,7 @@ public function returnsNotCanceledDatesOnMixedIntervals(): void { $subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin'); - $result = $subject->createDates($this->createStub(Import::class), [ + $result = $subject->createDates(self::createStub(Import::class), [ [ 'start' => '2022-06-21T16:00:00+02:00', 'end' => '2022-06-21T22:00:00+02:00', diff --git a/Tests/Unit/Service/DestinationDataImportService/LocationAssignmentTest.php b/Tests/Unit/Service/DestinationDataImportService/LocationAssignmentTest.php index 7dae8abb..1d16aef0 100644 --- a/Tests/Unit/Service/DestinationDataImportService/LocationAssignmentTest.php +++ b/Tests/Unit/Service/DestinationDataImportService/LocationAssignmentTest.php @@ -42,7 +42,7 @@ protected function setUp(): void #[Test] public function canBeCreated(): void { - $repository = $this->createStub(LocationRepository::class); + $repository = self::createStub(LocationRepository::class); $subject = new LocationAssignment( $repository ); @@ -63,7 +63,7 @@ public function normalizesLatitudeAndLongitude( $latitude, $longitude ): void { - $repository = $this->createStub(LocationRepository::class); + $repository = self::createStub(LocationRepository::class); $repository->method('findOneByGlobalId')->willReturn(null); $subject = new LocationAssignment(