From f15cf55ae6d15f6b41c2d2b096de62687d1e0645 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 7 Nov 2023 10:37:52 +0100 Subject: [PATCH] BREAKING: TYPO3 v12 support * Migrated all fixtures to PHP. * Removed version specific adjustments. --- .gitattributes | 1 + .github/workflows/ci.yaml | 45 +- .php-cs-fixer.dist.php | 10 +- .../Pagination/SlidingWindowPagination.php | 178 ---- Classes/Caching/CacheManager.php | 13 +- Classes/Caching/PageCacheTimeout.php | 51 +- ...inationDataViaAllConfigruationsCommand.php | 18 +- ...DestinationDataViaConfigruationCommand.php | 21 +- Classes/Command/RemoveAllCommand.php | 11 +- Classes/Command/RemovePastCommand.php | 11 +- Classes/Controller/AbstractController.php | 22 +- Classes/Controller/DateController.php | 107 +-- Classes/Controller/EventController.php | 45 +- .../Domain/DestinationData/ImportFactory.php | 50 +- Classes/Domain/Model/Category.php | 38 +- Classes/Domain/Model/Date.php | 123 +-- Classes/Domain/Model/Dto/DateDemand.php | 98 +- .../Domain/Model/Dto/DateDemandFactory.php | 15 +- Classes/Domain/Model/Dto/EventDemand.php | 2 + .../Domain/Model/Dto/EventDemandFactory.php | 2 + Classes/Domain/Model/Event.php | 139 +-- Classes/Domain/Model/Import.php | 73 +- Classes/Domain/Model/Location.php | 80 +- Classes/Domain/Model/Organizer.php | 61 +- Classes/Domain/Model/Partner.php | 14 +- Classes/Domain/Model/Region.php | 12 +- .../Domain/Repository/CategoryRepository.php | 31 +- Classes/Domain/Repository/DateRepository.php | 90 +- Classes/Domain/Repository/EventRepository.php | 10 +- .../Domain/Repository/LocationRepository.php | 4 +- .../Domain/Repository/OrganizerRepository.php | 4 +- .../Domain/Repository/RegionRepository.php | 4 +- .../Events/Controller/DateListVariables.php | 52 +- .../Events/Controller/DateSearchVariables.php | 63 +- Classes/Extbase/AddSpecialProperties.php | 29 +- Classes/Pagination/Factory.php | 4 +- Classes/Service/CategoryService.php | 29 +- Classes/Service/Cleanup/Database.php | 73 +- Classes/Service/Cleanup/Files.php | 61 +- Classes/Service/CleanupService.php | 22 +- Classes/Service/DataProcessingForModels.php | 47 +- .../Service/DestinationDataImportService.php | 170 +--- .../CategoriesAssignment.php | 20 +- .../CategoriesAssignment/Import.php | 36 +- .../DataFetcher.php | 43 +- .../DataHandler.php | 9 +- .../DataHandler/Assignment.php | 21 +- .../DatesFactory.php | 96 +- .../Events/CategoriesAssignEvent.php | 10 +- .../Events/EventImportEvent.php | 16 +- .../FilesAssignment.php | 41 +- .../LocationAssignment.php | 16 +- .../DestinationDataImportService/Slugger.php | 38 +- .../Slugger/Date.php | 15 +- .../Slugger/Event.php | 2 +- .../Slugger/Registry.php | 8 +- .../UrlFactory.php | 12 +- .../Testing/TypoScriptInstructionModifier.php | 54 -- Classes/Updates/MigrateDuplicateLocations.php | 25 +- Classes/Updates/MigrateOldLocations.php | 49 +- Configuration/Extbase/Persistence/Classes.php | 4 +- Configuration/Services.yaml | 3 + Configuration/TCA/Overrides/pages.php | 15 +- Configuration/TCA/Overrides/sys_category.php | 6 +- Configuration/TCA/Overrides/sys_template.php | 6 +- Configuration/TCA/Overrides/tt_content.php | 21 +- .../tx_events_domain_model_event.php | 29 - .../TCA/tx_events_domain_model_date.php | 78 +- .../TCA/tx_events_domain_model_event.php | 128 +-- .../TCA/tx_events_domain_model_import.php | 15 +- .../TCA/tx_events_domain_model_location.php | 37 +- .../TCA/tx_events_domain_model_organizer.php | 37 +- .../TCA/tx_events_domain_model_partner.php | 42 +- .../TCA/tx_events_domain_model_region.php | 37 +- Configuration/TypoScript/setup.typoscript | 4 - Documentation/Changelog/4.0.0.rst | 12 +- Documentation/Index.rst | 1 - Documentation/Maintenance.rst | 16 - Documentation/Maintenance/TYPO3/V10.rst | 17 - Documentation/Maintenance/TYPO3/V11.rst | 12 - Patches/testing-framework-request-state.patch | 30 + Patches/testing-framework-ts-record.patch | 18 + Tests/ClientFactory.php | 2 + .../Functional/AbstractFunctionalTestCase.php | 37 +- .../Fixtures/RemoveAllTestDatabase.php | 9 +- .../Fixtures/RemovePastTestDatabase.php | 25 +- Tests/Functional/Cleanup/RemoveAllTest.php | 12 +- Tests/Functional/Cleanup/RemovePastTest.php | 12 +- Tests/Functional/Fixtures/BeUsers.php | 19 + Tests/Functional/Frontend/CacheTest.php | 77 +- Tests/Functional/Frontend/DatesTest.php | 48 +- .../Returns404IfEventIsHidden.csv | 9 - .../Returns404IfEventIsHidden.php | 32 + .../ReturnsDateWithinTimeSpan.csv | 25 - .../ReturnsDateWithinTimeSpan.php | 127 +++ ...rnsOnlyDatesWithAvailableEventByDemand.csv | 11 - ...rnsOnlyDatesWithAvailableEventByDemand.php | 45 + .../ReturnsUpcomingDates.php | 2 +- Tests/Functional/Frontend/FilterTest.php | 17 +- .../FilterByASingleLocationViaFlexform.php | 2 + .../FilterByTwoLocationsViaFlexform.php | 2 + .../Fixtures/Database/SiteStructure.php | 2 + .../Extensions/example/Classes/UserFunc.php | 12 +- .../Extensions/example/ext_emconf.php | 2 + .../Extensions/example/ext_localconf.php | 9 +- ...{AbstractTest.php => AbstractTestCase.php} | 4 +- .../ImportDoesntBreakWithLongFileTitle.csv | 23 - .../ImportDoesntBreakWithLongFileTitle.php | 136 +++ ...ImportDoesntEndUpInEndlessDateCreation.php | 90 ++ ...rtDoesntEndUpInEndlessDateCreationTest.csv | 10 - ...sImagesAddsMultipleImagestoSingleEvent.php | 10 +- ...dlesImagesAddsNewImageToExistingImages.php | 13 +- .../ImportHandlesImagesAddsNewImages.php | 13 +- ...lesImagesRemovesNoLongerExistingImages.php | 10 +- ...mportHandlesImagesUpdatesExistingImage.php | 10 +- ...ortHandlesImagesUpdatesSortingOfImages.php | 10 +- .../Assertions/ImportsAllConfiguration.php | 886 ++++++++++++++++++ .../ImportsAllConfigurationTest.csv | 61 -- .../Assertions/ImportsExampleAsExpected.csv | 49 - .../Assertions/ImportsExampleAsExpected.php | 598 ++++++++++++ .../ImportsFeaturesAddsNewFeatures.csv | 29 - .../ImportsFeaturesAddsNewFeatures.php | 177 ++++ .../ImportsFirstDateOfRecurringDatesDaily.csv | 10 - .../ImportsFirstDateOfRecurringDatesDaily.php | 52 + ...ImportsFirstDateOfRecurringDatesWeekly.csv | 8 - ...ImportsFirstDateOfRecurringDatesWeekly.php | 38 + .../ImportsFirstDateOfSingleDate.csv | 6 - .../ImportsFirstDateOfSingleDate.php | 24 + ...ingDatesDailyWithConfiguredRepeatUntil.csv | 15 - ...ingDatesDailyWithConfiguredRepeatUntil.php | 87 ++ ...ngDatesWeeklyWithConfiguredRepeatUntil.csv | 9 - ...ngDatesWeeklyWithConfiguredRepeatUntil.php | 45 + .../Assertions/ImportsSource.php | 2 + .../Assertions/ImportsTickets.csv | 4 - .../Assertions/ImportsTickets.php | 22 + .../Assertions/ImportsWithLocations.php | 4 +- .../ImportsWithSingleLocationOnDuplicates.php | 2 + .../ImportsWithoutCategoryIfNotProvided.csv | 10 - .../ImportsWithoutCategoryIfNotProvided.php | 136 +++ .../ImportsWithoutLocationIfNotProvided.csv | 6 - .../ImportsWithoutLocationIfNotProvided.php | 52 + .../ImportsWithoutRegionIfNotProvided.csv | 10 - .../ImportsWithoutRegionIfNotProvided.php | 136 +++ .../Assertions/UpdatesExistingLocation.php | 2 + .../Database/DefaultImportConfiguration.php | 2 + .../Fixtures/Database/ExistingFeatures.php | 2 + .../Fixtures/Database/ExistingLocation.php | 2 + .../Database/FeaturesImportConfiguration.php | 2 + ...ateOfRecurringDatesImportConfiguration.php | 2 + .../ImportHandlesImagesExistingData.php | 10 +- .../Database/MinimalImportConfiguration.php | 2 + .../Database/SecondImportConfiguration.php | 2 + .../Fixtures/Database/SingleCategory.php | 2 + .../Database/SingleImportConfiguration.php | 2 + ...ingleImportConfigurationWithCategories.php | 2 + ...SingleImportConfigurationWithoutRegion.php | 2 + .../Fixtures/Database/SingleRegion.php | 2 + .../Fixtures/Database/Structure.php | 2 + .../ImportCleansTransientFilesTest.php | 14 +- .../ImportDoesNotUseUploadsFolderTest.php | 14 +- ...ImportDoesntBreakWithLongFileTitleTest.php | 11 +- ...rtDoesntEndUpInEndlessDateCreationTest.php | 14 +- .../ImportHandlesImagesTest.php | 34 +- .../ImportsAllConfigurationTest.php | 20 +- .../ImportsExampleAsExpectedTest.php | 24 +- .../ImportsFeaturesTest.php | 23 +- .../ImportsFirstDateOfDatesTest.php | 32 +- .../ImportsSingleConfigurationTest.php | 20 +- .../ImportsTicketsTest.php | 15 +- .../ImportsWithConfiguredRepeatUntilTest.php | 26 +- .../ImportsWithLocationsTest.php | 21 +- ...mportsWithoutCategoryIfNotProvidedTest.php | 16 +- .../ImportsWithoutLocationTest.php | 16 +- .../ImportsWithoutRegionIfNotProvidedTest.php | 16 +- ...HandlerCanKeepCustomCategoriesAssigned.php | 2 + .../RegisteredEventHandlerCanModifyEvent.php | 6 +- .../CategoriesAssignEventTest.php | 9 +- .../EventImportEventTest.php | 9 +- ...HandlerCanKeepCustomCategoriesAssigned.php | 2 + .../RegisteredEventHandlerCanModifyEvent.php | 2 + .../custom_categories/ext_emconf.php | 6 +- .../Extensions/custom_event/ext_emconf.php | 6 +- .../Assertions/MigrateDuplicateLocations.php | 2 + .../Fixtures/MigrateDuplicateLocations.php | 2 + .../MigrateDuplicateLocationsNoDuplicates.php | 2 + .../Updates/MigrateDuplicateLocationsTest.php | 29 +- Tests/ProphecyTrait.php | 18 - Tests/Unit/Domain/Model/CategoryTest.php | 20 +- Tests/Unit/Domain/Model/DateTest.php | 71 +- .../Model/Dto/DateDemandFactoryTest.php | 102 +- .../Unit/Domain/Model/Dto/DateDemandTest.php | 82 ++ .../Model/Dto/EventDemandFactoryTest.php | 12 +- Tests/Unit/Domain/Model/EventTest.php | 16 +- Tests/Unit/Domain/Model/ImportTest.php | 109 +-- Tests/Unit/Domain/Model/LocationTest.php | 12 +- .../Controller/DateListVariablesTest.php | 63 +- .../Controller/DateSearchVariablesTest.php | 61 +- .../DatesFactoryTest.php | 81 +- .../LocationAssignmentTest.php | 22 +- .../UrlFactoryTest.php | 76 +- composer.json | 46 +- ext_emconf.php | 6 +- ext_localconf.php | 41 +- ext_tables.php | 19 - phpstan-baseline.neon | 117 +-- phpstan.neon | 17 +- phpunit.xml.dist | 27 +- shell.nix | 6 +- 208 files changed, 4384 insertions(+), 3428 deletions(-) delete mode 100644 Classes/Backports/V12/Pagination/SlidingWindowPagination.php delete mode 100644 Classes/Testing/TypoScriptInstructionModifier.php delete mode 100644 Configuration/TCA/Overrides/tx_events_domain_model_event.php delete mode 100644 Documentation/Maintenance.rst delete mode 100644 Documentation/Maintenance/TYPO3/V10.rst delete mode 100644 Documentation/Maintenance/TYPO3/V11.rst create mode 100644 Patches/testing-framework-request-state.patch create mode 100644 Patches/testing-framework-ts-record.patch create mode 100644 Tests/Functional/Fixtures/BeUsers.php delete mode 100644 Tests/Functional/Frontend/DatesTestFixtures/Returns404IfEventIsHidden.csv create mode 100644 Tests/Functional/Frontend/DatesTestFixtures/Returns404IfEventIsHidden.php delete mode 100644 Tests/Functional/Frontend/DatesTestFixtures/ReturnsDateWithinTimeSpan.csv create mode 100644 Tests/Functional/Frontend/DatesTestFixtures/ReturnsDateWithinTimeSpan.php delete mode 100644 Tests/Functional/Frontend/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.csv create mode 100644 Tests/Functional/Frontend/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.php rename Tests/Functional/Import/DestinationDataTest/{AbstractTest.php => AbstractTestCase.php} (87%) delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportDoesntBreakWithLongFileTitle.csv create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportDoesntBreakWithLongFileTitle.php create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportDoesntEndUpInEndlessDateCreation.php delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportDoesntEndUpInEndlessDateCreationTest.csv create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsAllConfiguration.php delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsAllConfigurationTest.csv delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.php delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFeaturesAddsNewFeatures.csv create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFeaturesAddsNewFeatures.php delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesDaily.csv create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesDaily.php delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesWeekly.csv create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesWeekly.php delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfSingleDate.csv create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfSingleDate.php delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesDailyWithConfiguredRepeatUntil.csv create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesDailyWithConfiguredRepeatUntil.php delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesWeeklyWithConfiguredRepeatUntil.csv create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesWeeklyWithConfiguredRepeatUntil.php delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsTickets.csv create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsTickets.php delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutCategoryIfNotProvided.csv create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutCategoryIfNotProvided.php delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutLocationIfNotProvided.csv create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutLocationIfNotProvided.php delete mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutRegionIfNotProvided.csv create mode 100644 Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutRegionIfNotProvided.php delete mode 100644 Tests/ProphecyTrait.php create mode 100644 Tests/Unit/Domain/Model/Dto/DateDemandTest.php delete mode 100644 ext_tables.php diff --git a/.gitattributes b/.gitattributes index ae77c430..0a506e71 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ Tests export-ignore +Patches export-ignore .gitlab-ci.yml export-ignore shell.nix export-ignore diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d3b0a5cb..c689855a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,12 +15,9 @@ jobs: strategy: matrix: php-version: - - 7.2 - - 7.3 - - 7.4 - - 8.0 - 8.1 - 8.2 + - 8.3 steps: - name: Checkout uses: actions/checkout@v3 @@ -43,7 +40,7 @@ jobs: - name: Install PHP uses: shivammathur/setup-php@v2 with: - php-version: "7.4" + php-version: "8.2" tools: composer:v2 - name: Install xmllint @@ -71,14 +68,14 @@ jobs: - name: Install PHP uses: shivammathur/setup-php@v2 with: - php-version: "8.1" + php-version: "8.2" tools: composer:v2 - name: Install dependencies run: composer install --prefer-dist --no-progress --no-suggest - name: Coding Guideline - run: ./vendor/bin/php-cs-fixer fix + run: ./vendor/bin/php-cs-fixer fix --dry-run --diff code-quality: runs-on: ubuntu-latest @@ -87,20 +84,12 @@ jobs: strategy: matrix: include: - - php-version: '7.2' - typo3-version: '^10.4' - - php-version: '7.3' - typo3-version: '^10.4' - - php-version: '7.4' - typo3-version: '^10.4' - - php-version: '7.4' - typo3-version: '^11.5' - - php-version: '8.0' - typo3-version: '^11.5' - php-version: '8.1' - typo3-version: '^11.5' + typo3-version: '^12.4' - php-version: '8.2' - typo3-version: '^11.5' + typo3-version: '^12.4' + - php-version: '8.3' + typo3-version: '^12.4' steps: - uses: actions/checkout@v3 @@ -124,20 +113,12 @@ jobs: strategy: matrix: include: - - php-version: '7.2' - typo3-version: '^10.4' - - php-version: '7.3' - typo3-version: '^10.4' - - php-version: '7.4' - typo3-version: '^10.4' - - php-version: '7.4' - typo3-version: '^11.5' - - php-version: '8.0' - typo3-version: '^11.5' - php-version: '8.1' - typo3-version: '^11.5' + typo3-version: '^12.4' - php-version: '8.2' - typo3-version: '^11.5' + typo3-version: '^12.4' + - php-version: '8.3' + typo3-version: '^12.4' steps: - uses: actions/checkout@v3 @@ -151,4 +132,4 @@ jobs: run: composer require --no-interaction --prefer-dist --no-progress "typo3/cms-core:${{ matrix.typo3-version }}" "typo3/cms-extbase:${{ matrix.typo3-version }}" "typo3/cms-frontend:${{ matrix.typo3-version }}" "typo3/cms-fluid:${{ matrix.typo3-version }}" "typo3/cms-filelist:${{ matrix.typo3-version }}" "typo3/cms-backend:${{ matrix.typo3-version }}" "typo3/cms-fluid-styled-content:${{ matrix.typo3-version }}" - name: PHPUnit Tests - run: ./vendor/bin/phpunit --testdox + run: ./vendor/bin/phpunit --display-incomplete --display-skipped --display-deprecations --display-errors --display-notices --display-warnings diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index df861ff9..5bd6dc42 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -9,20 +9,26 @@ ->setRules([ '@DoctrineAnnotation' => true, '@PSR2' => true, + 'array_indentation' => true, 'array_syntax' => ['syntax' => 'short'], + 'attribute_empty_parentheses' => true, 'blank_line_after_opening_tag' => true, 'braces' => ['allow_single_line_closure' => true], 'cast_spaces' => ['space' => 'none'], 'compact_nullable_typehint' => true, 'concat_space' => ['spacing' => 'one'], 'declare_equal_normalize' => ['space' => 'none'], + 'declare_strict_types' => true, 'dir_constant' => true, + 'fully_qualified_strict_types' => false, 'function_to_constant' => ['functions' => ['get_called_class', 'get_class', 'get_class_this', 'php_sapi_name', 'phpversion', 'pi']], 'function_typehint_space' => true, + 'global_namespace_import' => ['import_classes' => true, 'import_constants' => true, 'import_functions' => true], 'lowercase_cast' => true, 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], 'modernize_strpos' => true, 'modernize_types_casting' => true, + 'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'], 'native_function_casing' => true, 'new_with_braces' => true, 'no_alias_functions' => true, @@ -32,12 +38,14 @@ 'no_extra_blank_lines' => true, 'no_leading_import_slash' => true, 'no_leading_namespace_whitespace' => true, + 'no_multiline_whitespace_around_double_arrow' => true, 'no_null_property_initialization' => true, 'no_short_bool_cast' => true, 'no_singleline_whitespace_before_semicolons' => true, 'no_superfluous_elseif' => true, 'no_trailing_comma_in_singleline_array' => true, 'no_unneeded_control_parentheses' => true, + 'no_unneeded_import_alias' => true, 'no_unused_imports' => true, 'no_useless_else' => true, 'no_whitespace_in_blank_line' => true, @@ -54,8 +62,8 @@ 'phpdoc_types' => true, 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], 'return_type_declaration' => ['space_before' => 'none'], - 'single_quote' => true, 'single_line_comment_style' => ['comment_types' => ['hash']], + 'single_quote' => true, 'single_trait_insert_per_statement' => true, 'trailing_comma_in_multiline' => ['elements' => ['arrays']], 'whitespace_after_comma_in_array' => true, diff --git a/Classes/Backports/V12/Pagination/SlidingWindowPagination.php b/Classes/Backports/V12/Pagination/SlidingWindowPagination.php deleted file mode 100644 index ec77939e..00000000 --- a/Classes/Backports/V12/Pagination/SlidingWindowPagination.php +++ /dev/null @@ -1,178 +0,0 @@ -paginator = $paginator; - - if ($maximumNumberOfLinks > 0) { - $this->maximumNumberOfLinks = $maximumNumberOfLinks; - } - - $this->calculateDisplayRange(); - } - - public function getPreviousPageNumber(): ?int - { - $previousPage = $this->paginator->getCurrentPageNumber() - 1; - - if ($previousPage > $this->paginator->getNumberOfPages()) { - return null; - } - - return $previousPage >= $this->getFirstPageNumber() ? $previousPage : null; - } - - public function getNextPageNumber(): ?int - { - $nextPage = $this->paginator->getCurrentPageNumber() + 1; - - return $nextPage <= $this->paginator->getNumberOfPages() ? $nextPage : null; - } - - public function getFirstPageNumber(): int - { - return 1; - } - - public function getLastPageNumber(): int - { - return $this->paginator->getNumberOfPages(); - } - - public function getStartRecordNumber(): int - { - if ($this->paginator->getCurrentPageNumber() > $this->paginator->getNumberOfPages()) { - return 0; - } - - return $this->paginator->getKeyOfFirstPaginatedItem() + 1; - } - - public function getEndRecordNumber(): int - { - if ($this->paginator->getCurrentPageNumber() > $this->paginator->getNumberOfPages()) { - return 0; - } - - return $this->paginator->getKeyOfLastPaginatedItem() + 1; - } - - public function getAllPageNumbers(): array - { - return range($this->displayRangeStart, $this->displayRangeEnd); - } - - public function getDisplayRangeStart(): int - { - return $this->displayRangeStart; - } - - public function getDisplayRangeEnd(): int - { - return $this->displayRangeEnd; - } - - public function getHasLessPages(): bool - { - return $this->hasLessPages; - } - - public function getHasMorePages(): bool - { - return $this->hasMorePages; - } - - public function getMaximumNumberOfLinks(): int - { - return $this->maximumNumberOfLinks; - } - - public function getPaginator(): PaginatorInterface - { - return $this->paginator; - } - - protected function calculateDisplayRange(): void - { - $maximumNumberOfLinks = $this->maximumNumberOfLinks; - $numberOfPages = $this->paginator->getNumberOfPages(); - - if ($maximumNumberOfLinks > $numberOfPages) { - $maximumNumberOfLinks = $numberOfPages; - } - - $currentPage = $this->paginator->getCurrentPageNumber(); - $delta = floor($maximumNumberOfLinks / 2); - - $this->displayRangeStart = (int)($currentPage - $delta); - $this->displayRangeEnd = (int)($currentPage + $delta - ($maximumNumberOfLinks % 2 === 0 ? 1 : 0)); - - if ($this->displayRangeStart < 1) { - $this->displayRangeEnd -= $this->displayRangeStart - 1; - } - - if ($this->displayRangeEnd > $numberOfPages) { - $this->displayRangeStart -= $this->displayRangeEnd - $numberOfPages; - } - - $this->displayRangeStart = (int)max($this->displayRangeStart, 1); - $this->displayRangeEnd = (int)min($this->displayRangeEnd, $numberOfPages); - $this->hasLessPages = $this->displayRangeStart > 2; - $this->hasMorePages = $this->displayRangeEnd + 1 < $this->paginator->getNumberOfPages(); - } -} diff --git a/Classes/Caching/CacheManager.php b/Classes/Caching/CacheManager.php index 655a631d..6493b120 100644 --- a/Classes/Caching/CacheManager.php +++ b/Classes/Caching/CacheManager.php @@ -28,15 +28,7 @@ class CacheManager { - /** - * @var Typo3CacheManager - */ - private $cacheManager; - - /** - * @var array - */ - private $tags = [ + private array $tags = [ 'tx_events_domain_model_date', 'tx_events_domain_model_event', 'tx_events_domain_model_organizer', @@ -45,9 +37,8 @@ class CacheManager ]; public function __construct( - Typo3CacheManager $cacheManager + private readonly Typo3CacheManager $cacheManager ) { - $this->cacheManager = $cacheManager; } public function addAllCacheTagsToPage(ContentObjectRenderer $cObject): void diff --git a/Classes/Caching/PageCacheTimeout.php b/Classes/Caching/PageCacheTimeout.php index e64cc264..1492e896 100644 --- a/Classes/Caching/PageCacheTimeout.php +++ b/Classes/Caching/PageCacheTimeout.php @@ -30,6 +30,7 @@ use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\SingletonInterface; +use TYPO3\CMS\Frontend\Event\ModifyCacheLifetimeForPageEvent; use WerkraumMedia\Events\Domain\Model\Date; use WerkraumMedia\Events\Events\Controller\DateListVariables; @@ -41,40 +42,30 @@ */ class PageCacheTimeout implements SingletonInterface { - /** - * @var DateTimeImmutable|null - */ - private $timeout; + private ?DateTimeImmutable $timeout = null; - /** - * @var FrontendInterface - */ - private $runtimeCache; - - /** - * @var Context - */ - private $context; + private FrontendInterface $runtimeCache; public function __construct( CacheManager $cacheManager, - Context $context + private readonly Context $context ) { $this->runtimeCache = $cacheManager->getCache('runtime'); - $this->context = $context; } - public function calculateCacheTimout( - array $parameters - ): int { - $typo3Timeout = $parameters['cacheTimeout']; + public function modifyCacheLifetimeForPage(ModifyCacheLifetimeForPageEvent $event): void + { $ourTimeout = $this->getTimeout(); - if ($ourTimeout === null) { - return $typo3Timeout; + return; } - return min($typo3Timeout, $ourTimeout); + $event->setCacheLifetime( + min( + $event->getCacheLifetime(), + $ourTimeout + ) + ); } public function trackDates(DateListVariables $event): void @@ -85,14 +76,10 @@ public function trackDates(DateListVariables $event): void } if ($event->getDemand()->shouldShowUpcoming()) { - $this->trackTimeoutByDate($event, static function (Date $date) { - return $date->getStart(); - }); + $this->trackTimeoutByDate($event, static fn (Date $date) => $date->getStart()); } - $this->trackTimeoutByDate($event, static function (Date $date) { - return $date->getEnd(); - }); + $this->trackTimeoutByDate($event, static fn (Date $date) => $date->getEnd()); } /** @@ -126,7 +113,8 @@ private function updateTimeout(DateTimeImmutable $newTimeout): void return; } - $this->runtimeCache->remove('core-tslib_fe-get_cache_timeout'); + $id = $GLOBALS['TYPO3_REQUEST']->getAttribute('routing')->getPageId(); + $this->runtimeCache->remove('cacheLifeTimeForPage_' . $id); $this->timeout = $newTimeout; } @@ -149,9 +137,4 @@ private function getExecution(): DateTimeImmutable return $execution; } - - public static function register(): void - { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['get_cache_timeout']['events'] = self::class . '->calculateCacheTimout'; - } } diff --git a/Classes/Command/ImportDestinationDataViaAllConfigruationsCommand.php b/Classes/Command/ImportDestinationDataViaAllConfigruationsCommand.php index 381d02a6..c7f3e6ac 100644 --- a/Classes/Command/ImportDestinationDataViaAllConfigruationsCommand.php +++ b/Classes/Command/ImportDestinationDataViaAllConfigruationsCommand.php @@ -1,5 +1,7 @@ destinationDataImportService = $destinationDataImportService; - $this->importFactory = $importFactory; } public function configure(): void diff --git a/Classes/Command/ImportDestinationDataViaConfigruationCommand.php b/Classes/Command/ImportDestinationDataViaConfigruationCommand.php index d69c353e..412f6fdb 100644 --- a/Classes/Command/ImportDestinationDataViaConfigruationCommand.php +++ b/Classes/Command/ImportDestinationDataViaConfigruationCommand.php @@ -1,7 +1,10 @@ destinationDataImportService = $destinationDataImportService; - $this->importFactory = $importFactory; } public function configure(): void @@ -51,7 +42,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if (is_numeric($configurationUid)) { $configurationUid = (int)$configurationUid; } else { - throw new \Exception('No numeric uid for configuration provided.', 1643267138); + throw new Exception('No numeric uid for configuration provided.', 1643267138); } $import = $this->importFactory->createFromUid( diff --git a/Classes/Command/RemoveAllCommand.php b/Classes/Command/RemoveAllCommand.php index 8b15e2f0..f1e69aba 100644 --- a/Classes/Command/RemoveAllCommand.php +++ b/Classes/Command/RemoveAllCommand.php @@ -1,5 +1,7 @@ cleanupService = $cleanupService; - parent::__construct(); } diff --git a/Classes/Command/RemovePastCommand.php b/Classes/Command/RemovePastCommand.php index cce533b6..76377e3a 100644 --- a/Classes/Command/RemovePastCommand.php +++ b/Classes/Command/RemovePastCommand.php @@ -1,5 +1,7 @@ cleanupService = $cleanupService; - parent::__construct(); } diff --git a/Classes/Controller/AbstractController.php b/Classes/Controller/AbstractController.php index b99c67ee..b674565c 100644 --- a/Classes/Controller/AbstractController.php +++ b/Classes/Controller/AbstractController.php @@ -1,5 +1,7 @@ configurationManager->getContentObject(); + $cObject = $this->request->getAttribute('currentContentObject'); if ($cObject instanceof ContentObjectRenderer) { $this->cacheManager->addAllCacheTagsToPage($cObject); } @@ -58,12 +60,12 @@ protected function initializeAction(): void /** * Extend original to also add data from current cobject if available. */ - protected function resolveView() + protected function resolveView(): ViewInterface { $view = parent::resolveView(); $view->assign('data', []); - $cObject = $this->configurationManager->getContentObject(); + $cObject = $this->request->getAttribute('currentContentObject'); if ($cObject instanceof ContentObjectRenderer && is_array($cObject->data)) { $view->assign('data', $cObject->data); } @@ -73,17 +75,9 @@ protected function resolveView() protected function trigger404(string $message): void { - $errorController = GeneralUtility::makeInstance(ErrorController::class); - - if (class_exists(ImmediateResponseException::class)) { - throw new ImmediateResponseException( - $errorController->pageNotFoundAction($GLOBALS['TYPO3_REQUEST'], $message), - 1695881164 - ); - } - throw new PropagateResponseException( - $errorController->pageNotFoundAction($this->request, $message), + GeneralUtility::makeInstance(ErrorController::class) + ->pageNotFoundAction($this->request, $message), 1695881170 ); } diff --git a/Classes/Controller/DateController.php b/Classes/Controller/DateController.php index 512e06c0..1d6349ad 100644 --- a/Classes/Controller/DateController.php +++ b/Classes/Controller/DateController.php @@ -1,9 +1,12 @@ demandFactory = $demandFactory; - $this->dateRepository = $dateRepository; - $this->regionRepository = $regionRepository; - $this->categoryRepository = $categoryRepository; - $this->paginationFactory = $paginationFactory; - $this->dataProcessing = $dataProcessing; - $this->eventDispatcher = $eventDispatcher; - $this->extensionService = $extensionService; } protected function initializeAction(): void { parent::initializeAction(); - $contentObject = $this->configurationManager->getContentObject(); + $contentObject = $this->request->getAttribute('currentContentObject'); if ($contentObject !== null) { $this->demandFactory->setContentObjectRenderer($contentObject); } @@ -91,14 +45,10 @@ protected function initializeAction(): void $this->handlePostRequest(); } - /** - * @param array $search - * @param int $currentPage - */ public function listAction( array $search = [], int $currentPage = 1 - ): void { + ): ResponseInterface { $demand = $this->demandFactory->fromSettings($this->settings); if ($search !== []) { $demand = $this->demandFactory->createFromRequestValues($search, $this->settings); @@ -117,15 +67,13 @@ public function listAction( ) )); if (!$event instanceof DateListVariables) { - throw new \Exception('Did not retrieve DateSearchVariables from event dispatcher, got: ' . get_class($event), 1657542318); + throw new Exception('Did not retrieve DateSearchVariables from event dispatcher, got: ' . $event::class, 1657542318); } $this->view->assignMultiple($event->getVariablesForView()); + return $this->htmlResponse(); } - /** - * @param array $search - */ - public function searchAction(array $search = []): void + public function searchAction(array $search = []): ResponseInterface { $demand = $this->demandFactory->fromSettings($this->settings); if ($search !== []) { @@ -136,33 +84,34 @@ public function searchAction(array $search = []): void $search, $demand, $this->regionRepository->findAll(), - $this->categoryRepository->findAllCurrentlyAssigned($this->settings['uids']['categoriesParent'] ?? 0, 'categories'), - $this->categoryRepository->findAllCurrentlyAssigned($this->settings['uids']['featuresParent'] ?? 0, 'features') + $this->categoryRepository->findAllCurrentlyAssigned((int)($this->settings['uids']['categoriesParent'] ?? 0), 'categories'), + $this->categoryRepository->findAllCurrentlyAssigned((int)($this->settings['uids']['featuresParent'] ?? 0), 'features') )); if (!$event instanceof DateSearchVariables) { - throw new \Exception('Did not retrieve DateSearchVariables from event dispatcher, got: ' . get_class($event), 1657542318); + throw new Exception('Did not retrieve DateSearchVariables from event dispatcher, got: ' . $event::class, 1657542318); } $this->view->assignMultiple($event->getVariablesForView()); + return $this->htmlResponse(); } - public function teaserAction(): void + public function teaserAction(): ResponseInterface { $dates = $this->dateRepository->findByUids($this->settings['eventUids']); $this->view->assign('dates', $dates); + return $this->htmlResponse(); } - /** - * @Extbase\IgnoreValidation("date") - */ - public function showAction(Date $date): void + #[Extbase\IgnoreValidation(['value' => 'date'])] + public function showAction(Date $date): ResponseInterface { try { $date->getEvent(); - } catch (Throwable $e) { + } catch (Throwable) { $this->trigger404('No event found for requested date.'); } $this->view->assign('date', $date); + return $this->htmlResponse(); } /** @@ -178,7 +127,7 @@ private function handlePostRequest(): void && is_array($this->request->getArgument('search')) ) { $namespace = $this->extensionService->getPluginNamespace(null, null); - $this->redirectToUri($this->configurationManager->getContentObject()->typoLink_URL([ + $this->redirectToUri($this->request->getAttribute('currentContentObject')->typoLink_URL([ 'parameter' => 't3://page?uid=current', 'additionalParams' => '&' . http_build_query([ $namespace => [ diff --git a/Classes/Controller/EventController.php b/Classes/Controller/EventController.php index c3ea6298..cbe0c78b 100644 --- a/Classes/Controller/EventController.php +++ b/Classes/Controller/EventController.php @@ -1,38 +1,23 @@ eventRepository = $eventRepository; - $this->dataProcessing = $dataProcessing; - $this->demandFactory = $demandFactory; } protected function initializeAction(): void @@ -42,35 +27,37 @@ protected function initializeAction(): void $this->dataProcessing->setConfigurationManager($this->configurationManager); } - public function listAction(): void + public function listAction(): ResponseInterface { $demand = $this->demandFactory->fromSettings($this->settings); $events = $this->eventRepository->findByDemand($demand); $this->view->assign('events', $events); + return $this->htmlResponse(); } - /** - * @Extbase\IgnoreValidation("event") - */ - public function showAction(Event $event): void + #[Extbase\IgnoreValidation(['value' => 'event'])] + public function showAction(Event $event): ResponseInterface { $this->view->assign('event', $event); + return $this->htmlResponse(); } /** * @deprecated Use listAction instead and configure settings properly. * Use Settings or something else to switch between list and teaser rendering. */ - public function teaserAction(): void + public function teaserAction(): ResponseInterface { $this->view->assignMultiple([ 'events' => $this->eventRepository->findByUids($this->settings['eventUids']), ]); + return $this->htmlResponse(); } - public function searchAction(string $search = ''): void + public function searchAction(string $search = ''): ResponseInterface { $this->view->assign('search', $search); $this->view->assign('events', $this->eventRepository->findSearchWord($search)); + return $this->htmlResponse(); } } diff --git a/Classes/Domain/DestinationData/ImportFactory.php b/Classes/Domain/DestinationData/ImportFactory.php index 515cf661..9bd5a56f 100644 --- a/Classes/Domain/DestinationData/ImportFactory.php +++ b/Classes/Domain/DestinationData/ImportFactory.php @@ -1,7 +1,11 @@ connectionPool = $connectionPool; - $this->extbasePersistenceSession = $extbasePersistenceSession; - $this->dataMapper = $dataMapper; - $this->resourceFactory = $resourceFactory; } public function createFromUid(int $uid): Import @@ -59,7 +39,7 @@ public function createFromUid(int $uid): Import public function createAll(): array { return array_map( - [$this, 'create'], + $this->create(...), $this->fetchImportRecords() ); } @@ -69,11 +49,11 @@ private function fetchImportRecord(int $uid): array $qb = $this->connectionPool->getQueryBuilderForTable('tx_events_domain_model_import'); $qb->select('*'); $qb->from('tx_events_domain_model_import'); - $qb->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid, \PDO::PARAM_INT))); + $qb->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid, PDO::PARAM_INT))); - $result = $qb->execute()->fetch(); + $result = $qb->executeQuery()->fetch(); if (is_array($result) === false) { - throw new \Exception('Could not fetch import record with uid "' . $uid . '".', 1643267492); + throw new Exception('Could not fetch import record with uid "' . $uid . '".', 1643267492); } $result = array_map('strval', $result); @@ -87,9 +67,9 @@ private function fetchImportRecords(): array $qb->select('*'); $qb->from('tx_events_domain_model_import'); - $result = $qb->execute()->fetchAll(); + $result = $qb->executeQuery()->fetchAll(); if (count($result) === 0) { - throw new \Exception('Could not fetch any import record.', 1643267492); + throw new Exception('Could not fetch any import record.', 1643267492); } foreach ($result as $key => $entry) { diff --git a/Classes/Domain/Model/Category.php b/Classes/Domain/Model/Category.php index ce32e709..ca1913cb 100644 --- a/Classes/Domain/Model/Category.php +++ b/Classes/Domain/Model/Category.php @@ -1,8 +1,10 @@ parent = $parent; $this->pid = $pid; - $this->title = $title; - $this->hidden = $hidden; } public function getTitle(): string @@ -60,10 +43,7 @@ public function getSorting(): int return $this->sorting; } - /** - * @return Category|null - */ - public function getParent() + public function getParent(): ?Category { if ($this->parent instanceof LazyLoadingProxy) { $this->parent->_loadRealInstance(); diff --git a/Classes/Domain/Model/Date.php b/Classes/Domain/Model/Date.php index 18f33402..820a73ee 100644 --- a/Classes/Domain/Model/Date.php +++ b/Classes/Domain/Model/Date.php @@ -1,7 +1,12 @@ start; } - /** - * @param \DateTime $start - * - * @return void - */ - public function setStart(\DateTime $start) + public function setStart(DateTime $start): void { $this->start = $start; } @@ -72,20 +43,12 @@ public function getHasUsefulStartTime(): bool return $this->getStart()->format('H:i') !== '00:00'; } - /** - * @return \DateTime|null end - */ - public function getEnd() + public function getEnd(): ?DateTime { return $this->end; } - /** - * @param \DateTime|null $end - * - * @return void - */ - public function setEnd($end) + public function setEnd(?DateTime $end): void { $this->end = $end; } @@ -102,55 +65,33 @@ public function getEndsOnSameDay(): bool return $end && $this->getStart()->format('Y-m-d') === $end->format('Y-m-d'); } - /** - * @return Event - */ public function getEvent(): Event { return $this->event; } - /** - * @param Event $event - */ public function setEvent(Event $event): self { $this->event = $event; return $this; } - /** - * @param int $languageUid - * - * @return void - */ - public function setLanguageUid($languageUid) + public function setLanguageUid(int $languageUid): void { $this->_languageUid = $languageUid; } - /** - * @return int - */ - public function getLanguageUid() + public function getLanguageUid(): int { return $this->_languageUid; } - /** - * @return string - */ public function getCanceled(): string { return $this->canceled; } - /** - * @param string $canceled - * - * @return void - */ - public function setCanceled(string $canceled) + public function setCanceled(string $canceled): void { $this->canceled = $canceled; } @@ -183,22 +124,22 @@ public static function createFromDestinationDataDate( bool $canceled ): self { return self::createFromDestinationData( - new \DateTimeImmutable($date['start'], new \DateTimeZone($date['tz'])), - new \DateTimeImmutable($date['end'], new \DateTimeZone($date['tz'])), + new DateTimeImmutable($date['start'], new DateTimeZone($date['tz'])), + new DateTimeImmutable($date['end'], new DateTimeZone($date['tz'])), $canceled ); } public static function createFromDestinationData( - \DateTimeImmutable $start, - \DateTimeImmutable $end, + DateTimeImmutable $start, + DateTimeImmutable $end, bool $canceled ): self { $date = new Date(); $date->setLanguageUid(-1); - $date->setStart(new \DateTime($start->format(\DateTime::W3C), $start->getTimezone())); - $date->setEnd(new \DateTime($end->format(\DateTime::W3C), $end->getTimezone())); + $date->setStart(new DateTime($start->format(DateTime::W3C), $start->getTimezone())); + $date->setEnd(new DateTime($end->format(DateTime::W3C), $end->getTimezone())); if ($canceled) { $date->setCanceled('canceled'); diff --git a/Classes/Domain/Model/Dto/DateDemand.php b/Classes/Domain/Model/Dto/DateDemand.php index 9c672cfb..93169900 100644 --- a/Classes/Domain/Model/Dto/DateDemand.php +++ b/Classes/Domain/Model/Dto/DateDemand.php @@ -1,118 +1,79 @@ ['word1', 'word2', …], * Synonym2 => ['word3', 'word4', …], * … */ - protected $synonyms = []; + protected array$synonyms = []; - /** - * @var bool - */ - protected $considerDate = false; + protected bool $considerDate = false; - /** - * @var string - */ - protected $queryCallback = ''; + protected string $queryCallback = ''; public function getSortBy(): string { @@ -165,7 +126,7 @@ public function setCategories(string $categories): void */ public function setFeatures(array $categories): void { - $this->features = array_map('intval', $categories); + $this->features = array_map('intval', array_filter($categories)); } /** @@ -303,7 +264,7 @@ public function getSynonymsForSearchword(): array return $this->synonyms[$searchWord] ?? []; } - public function getStartObject(): ?\DateTimeImmutable + public function getStartObject(): ?DateTimeImmutable { return $this->startObject; } @@ -327,10 +288,10 @@ public function setStart(?int $start): void if ($start === null) { return; } - $this->startObject = new \DateTimeImmutable(date('Y-m-d H:i', $start)); + $this->startObject = new DateTimeImmutable(date('Y-m-d H:i', $start)); } - public function getEndObject(): ?\DateTimeImmutable + public function getEndObject(): ?DateTimeImmutable { return $this->endObject; } @@ -364,7 +325,7 @@ public function setEnd(?int $end): void return; } - $this->endObject = new \DateTimeImmutable(date('Y-m-d H:i', $end)); + $this->endObject = new DateTimeImmutable(date('Y-m-d H:i', $end)); } public function setUseMidnight(bool $useMidnight): void @@ -387,8 +348,7 @@ public function shouldShowFromNow(): bool return $this->getStartObject() === null && $this->getEndObject() === null && $this->useMidnight === false - && $this->upcoming === false - ; + && $this->upcoming === false; } public function shouldShowFromMidnight(): bool diff --git a/Classes/Domain/Model/Dto/DateDemandFactory.php b/Classes/Domain/Model/Dto/DateDemandFactory.php index fbe4ad64..f8f9095b 100644 --- a/Classes/Domain/Model/Dto/DateDemandFactory.php +++ b/Classes/Domain/Model/Dto/DateDemandFactory.php @@ -1,5 +1,7 @@ typoScriptService = $typoScriptService; } public function setContentObjectRenderer( diff --git a/Classes/Domain/Model/Dto/EventDemand.php b/Classes/Domain/Model/Dto/EventDemand.php index 8263dc85..54c7ec70 100644 --- a/Classes/Domain/Model/Dto/EventDemand.php +++ b/Classes/Domain/Model/Dto/EventDemand.php @@ -1,5 +1,7 @@ - * - * @Extbase\ORM\Cascade remove */ - protected $images; + #[Cascade(['value' => 'remove'])] + protected ObjectStorage $images; /** * @var ObjectStorage - * - * @Extbase\ORM\Cascade remove - * @Extbase\ORM\Lazy */ - protected $dates; + #[Cascade(['value' => 'remove'])] + #[Lazy] + protected ObjectStorage $dates; - /** - * @var Location|null - */ - protected $location; + protected ?Location $location = null; - /** - * @var Organizer|null - */ - protected $organizer; + protected ?Organizer $organizer = null; - /** - * @var Region|null - */ - protected $region; + protected ?Region $region = null; - /** - * @var string - */ - protected $pages = ''; + protected string $pages = ''; /** * @var ObjectStorage */ - protected $categories; + protected ObjectStorage $categories; /** * @var ObjectStorage */ - protected $features; + protected ObjectStorage $features; /** * @var ObjectStorage */ - protected $partner; + protected ObjectStorage $partner; /** * @var ObjectStorage */ - protected $referencesEvents; + protected ObjectStorage $referencesEvents; - /** - * @var int - */ - protected $_languageUid; + protected DataProcessingForModels $dataProcessing; - /** - * @var DataProcessingForModels - */ - protected $dataProcessing; + protected string $sourceName = ''; - /** - * @var string - */ - protected $sourceName = ''; - - /** - * @var string - */ - protected $sourceUrl = ''; + protected string $sourceUrl = ''; public function __construct() { $this->initStorageObjects(); } - /** - * @param DataProcessingForModels $dataProcessing - */ public function injectDataProcessingForModels(DataProcessingForModels $dataProcessing): void { $this->dataProcessing = $dataProcessing; @@ -289,7 +222,7 @@ public function setInstagram(string $instagram): void } /** - * @return ObjectStorage $images + * @return ObjectStorage */ public function getImages(): ObjectStorage { @@ -466,9 +399,7 @@ private function getSortedCategory(ObjectStorage $categories): array { $categories = $categories->toArray(); - usort($categories, function (Category $catA, Category $catB) { - return $catA->getSorting() <=> $catB->getSorting(); - }); + usort($categories, fn (Category $catA, Category $catB) => $catA->getSorting() <=> $catB->getSorting()); return $categories; } diff --git a/Classes/Domain/Model/Import.php b/Classes/Domain/Model/Import.php index 99b23b67..400b0341 100644 --- a/Classes/Domain/Model/Import.php +++ b/Classes/Domain/Model/Import.php @@ -1,5 +1,7 @@ filesFolder = $filesFolder; - $this->storagePid = $storagePid; - // Do not allow categories on pid 0 if ($categoriesPid === 0) { $categoriesPid = null; } $this->categoriesPid = $categoriesPid; - $this->categoryParent = $categoryParent; // Do not allow features on pid 0 if ($featuresPid === 0) { $featuresPid = null; } $this->featuresPid = $featuresPid; - $this->featuresParent = $featuresParent; - - $this->restExperience = $restExperience; - $this->restSearchQuery = $restSearchQuery; - - $this->region = $region; } public function getStoragePid(): int diff --git a/Classes/Domain/Model/Location.php b/Classes/Domain/Model/Location.php index d552b659..993ca1d7 100644 --- a/Classes/Domain/Model/Location.php +++ b/Classes/Domain/Model/Location.php @@ -1,80 +1,27 @@ name = $name; - $this->street = $street; - $this->zip = $zip; - $this->city = $city; - $this->district = $district; - $this->country = $country; - $this->phone = $phone; $this->latitude = $this->normalizeGeocoordinate($latitude); $this->longitude = $this->normalizeGeocoordinate($longitude); $this->_languageUid = $languageUid; @@ -153,8 +100,7 @@ public function isValid(): bool || $this->city !== '' || $this->district !== '' || $this->country !== '' - || $this->phone !== '' - ; + || $this->phone !== ''; } private function generateGlobalId(): string diff --git a/Classes/Domain/Model/Organizer.php b/Classes/Domain/Model/Organizer.php index 9567e45c..74e8f156 100644 --- a/Classes/Domain/Model/Organizer.php +++ b/Classes/Domain/Model/Organizer.php @@ -1,5 +1,7 @@ */ - protected $images; + protected ObjectStorage $images; public function getTitle(): string { diff --git a/Classes/Domain/Model/Region.php b/Classes/Domain/Model/Region.php index 020fac9f..11d33dbd 100644 --- a/Classes/Domain/Model/Region.php +++ b/Classes/Domain/Model/Region.php @@ -1,5 +1,7 @@ connectionPool = $connectionPool; - } - - public function injectDataMapper(DataMapper $dataMapper): void - { - $this->dataMapper = $dataMapper; + public function __construct( + private readonly ConnectionPool $connectionPool, + private readonly DataMapper $dataMapper, + ) { + parent::__construct(); } /** @@ -88,7 +75,7 @@ public function findAllCurrentlyAssigned( return $this->dataMapper->map( Category::class, - $qb->execute()->fetchAll() + $qb->executeQuery()->fetchAll() ); } @@ -105,10 +92,10 @@ public function findOneForImport( $query->getQuerySettings()->setIgnoreEnableFields(true); $query->getQuerySettings()->setEnableFieldsToBeIgnored(['disabled']); - $query->matching($query->logicalAnd([ + $query->matching($query->logicalAnd( $query->equals('parent', $parentCategory), $query->equals('title', $title), - ])); + )); $query->setLimit(1); diff --git a/Classes/Domain/Repository/DateRepository.php b/Classes/Domain/Repository/DateRepository.php index fa475c1c..1c0ea661 100644 --- a/Classes/Domain/Repository/DateRepository.php +++ b/Classes/Domain/Repository/DateRepository.php @@ -1,5 +1,7 @@ context = $context; + public function __construct( + private readonly Context $context + ) { + parent::__construct(); } public function findByUids(string $uids): QueryResult @@ -95,27 +93,27 @@ protected function createDemandQuery(DateDemand $demand): QueryInterface $now = $now->modify('midnight'); } - $constraints['nowAndFuture'] = $query->logicalOr([ + $constraints['nowAndFuture'] = $query->logicalOr( $query->greaterThanOrEqual('start', $now), $query->greaterThanOrEqual('end', $now), - ]); + ); } elseif ($demand->shouldShowUpcoming()) { $now = $this->getNow(); - $constraints['future'] = $query->logicalAnd([ + $constraints['future'] = $query->logicalAnd( $query->greaterThan('start', $now), - $query->logicalOr([ + $query->logicalOr( $query->equals('end', 0), $query->greaterThan('end', $now), - ]), - ]); + ), + ); } if ($demand->getLimit() !== '') { $query->setLimit((int)$demand->getLimit()); } - $query->matching($query->logicalAnd($constraints)); + $query->matching($query->logicalAnd(... $constraints)); if ($demand->getSortBy() && $demand->getSortOrder()) { $query->setOrderings([$demand->getSortBy() => $demand->getSortOrder()]); @@ -146,8 +144,9 @@ private function getSearchwordConstraint( $wordsToSearch[] = $demand->getSearchword(); $constraints = []; - $queryBuilder = $this->objectManager->get(ConnectionPool::class) - ->getQueryBuilderForTable('tx_events_domain_model_date'); + $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) + ->getQueryBuilderForTable('tx_events_domain_model_date') + ; foreach ($wordsToSearch as $word) { foreach ($fieldsToSearch as $field) { @@ -155,7 +154,7 @@ private function getSearchwordConstraint( } } - return $query->logicalOr($constraints); + return $query->logicalOr(... $constraints); } protected function createCategoryConstraint( @@ -170,7 +169,8 @@ protected function createCategoryConstraint( if ($demand->getIncludeSubCategories()) { $categories = GeneralUtility::makeInstance(CategoryService::class) - ->getChildrenCategories($categories); + ->getChildrenCategories($categories) + ; } $categories = GeneralUtility::intExplode(',', $categories, true); @@ -183,10 +183,10 @@ protected function createCategoryConstraint( } if ($demand->getCategoryCombination() === 'or') { - return $query->logicalOr($constraints); + return $query->logicalOr(... $constraints); } - return $query->logicalAnd($constraints); + return $query->logicalAnd(... $constraints); } private function createTimingConstraint( @@ -196,42 +196,42 @@ private function createTimingConstraint( // Dates might have end of 0 if only start exists. if ($demand->getStartObject() !== null && $demand->getEndObject() === null) { - return $query->logicalOr([ + return $query->logicalOr( $query->greaterThanOrEqual('start', $demand->getStartObject()), $query->greaterThanOrEqual('end', $demand->getStartObject()), - ]); + ); } if ($demand->getStartObject() === null && $demand->getEndObject() !== null) { - return $query->logicalOr([ - $query->logicalAnd([ + return $query->logicalOr( + $query->logicalAnd( $query->lessThanOrEqual('end', $demand->getEndObject()), $query->greaterThan('end', 0), - ]), + ), $query->lessThanOrEqual('start', $demand->getEndObject()), - ]); + ); } if ($demand->getStartObject() !== null && $demand->getEndObject() !== null) { - return $query->logicalOr([ - $query->logicalAnd([ - $query->logicalOr([ + return $query->logicalOr( + $query->logicalAnd( + $query->logicalOr( $query->greaterThanOrEqual('start', $demand->getStartObject()), $query->greaterThanOrEqual('end', $demand->getStartObject()), - ]), - $query->logicalOr([ + ), + $query->logicalOr( $query->lessThanOrEqual('start', $demand->getEndObject()), - $query->logicalAnd([ + $query->logicalAnd( $query->lessThanOrEqual('end', $demand->getEndObject()), $query->greaterThan('end', 0), - ]), - ]), - ]), - $query->logicalAnd([ + ), + ), + ), + $query->logicalAnd( $query->lessThanOrEqual('start', $demand->getStartObject()), $query->greaterThanOrEqual('end', $demand->getEndObject()), - ]), - ]); + ), + ); } return null; @@ -247,13 +247,14 @@ private function createFeaturesConstraint( $constraints[] = $query->contains('event.features', $feature); } - return $query->logicalAnd($constraints); + return $query->logicalAnd(... $constraints); } public function findSearchWord(string $search): array { $connection = GeneralUtility::makeInstance(ConnectionPool::class) - ->getConnectionForTable('tx_events_domain_model_date'); + ->getConnectionForTable('tx_events_domain_model_date') + ; $queryBuilder = $connection->createQueryBuilder(); @@ -270,9 +271,10 @@ public function findSearchWord(string $search): array ) )->where( $queryBuilder->expr()->like('event.title', $queryBuilder->createNamedParameter('%' . $search . '%')) - )->orderBy('tx_events_domain_model_date.start'); + )->orderBy('tx_events_domain_model_date.start') + ; - return $statement->execute()->fetchAll(); + return $statement->executeQuery()->fetchAll(); } private function createEventConstraint( diff --git a/Classes/Domain/Repository/EventRepository.php b/Classes/Domain/Repository/EventRepository.php index 86284367..84787ca9 100644 --- a/Classes/Domain/Repository/EventRepository.php +++ b/Classes/Domain/Repository/EventRepository.php @@ -1,5 +1,7 @@ getConstraints($query, $demand); if (!empty($constraints)) { - $query->matching($query->logicalAnd($constraints)); + $query->matching($query->logicalAnd(... $constraints)); } if ($demand->getLimit() !== '') { @@ -148,9 +150,9 @@ protected function createCategoryConstraint(QueryInterface $query, EventDemand $ } if ($demand->getCategoryCombination() === 'or') { - return $query->logicalOr($constraints); + return $query->logicalOr(... $constraints); } - return $query->logicalAnd($constraints); + return $query->logicalAnd(... $constraints); } public function findSearchWord(string $search): QueryResult diff --git a/Classes/Domain/Repository/LocationRepository.php b/Classes/Domain/Repository/LocationRepository.php index 7abbba03..3a96ee4f 100644 --- a/Classes/Domain/Repository/LocationRepository.php +++ b/Classes/Domain/Repository/LocationRepository.php @@ -1,11 +1,13 @@ - */ - private $dates; - - /** - * @var PaginationInterface - */ - private $pagination; - - /** - * @var array - */ - private $variables = []; + private array $variables = []; public function __construct( - array $search, - DateDemand $demand, - QueryResult $dates, - PaginationInterface $pagination + private readonly array $search, + private readonly DateDemand $demand, + /** + * @var QueryResult + */ + private readonly QueryResult $dates, + private readonly PaginationInterface $pagination ) { - $this->search = $search; - $this->demand = $demand; - $this->dates = $dates; - $this->pagination = $pagination; } public function getSearch(): array @@ -64,21 +42,19 @@ public function getDates(): QueryResult return $this->dates; } - /** - * @param mixed $value - */ - public function addVariable(string $key, $value): void + public function addVariable(string $key, mixed $value): void { $this->variables[$key] = $value; } public function getVariablesForView(): array { - return array_merge([ + return [ 'search' => $this->search, 'demand' => $this->demand, 'dates' => $this->dates, 'pagination' => $this->pagination, - ], $this->variables); + ...$this->variables, + ]; } } diff --git a/Classes/Events/Controller/DateSearchVariables.php b/Classes/Events/Controller/DateSearchVariables.php index 610031c4..ba2dd105 100644 --- a/Classes/Events/Controller/DateSearchVariables.php +++ b/Classes/Events/Controller/DateSearchVariables.php @@ -1,59 +1,30 @@ - */ - private $regions; - - /** - * @var array - */ - private $categories; - - /** - * @var array - */ - private $features; - - /** - * @var array - */ - private $variables = []; + private array $variables = []; /** * @param QueryResultInterface $regions + * @param array $categories + * @param array $features */ public function __construct( - array $search, - DateDemand $demand, - QueryResultInterface $regions, - array $categories, - array $features + private readonly array $search, + private readonly DateDemand $demand, + private readonly QueryResultInterface $regions, + private readonly array $categories, + private readonly array $features ) { - $this->search = $search; - $this->demand = $demand; - $this->regions = $regions; - $this->categories = $categories; - $this->features = $features; } public function getSearch(): array @@ -84,22 +55,20 @@ public function getFeatures(): array return $this->features; } - /** - * @param mixed $value - */ - public function addVariable(string $key, $value): void + public function addVariable(string $key, mixed $value): void { $this->variables[$key] = $value; } public function getVariablesForView(): array { - return array_merge([ + return [ 'search' => $this->search, 'demand' => $this->demand, 'regions' => $this->regions, 'categories' => $this->categories, 'features' => $this->features, - ], $this->variables); + ...$this->variables, + ]; } } diff --git a/Classes/Extbase/AddSpecialProperties.php b/Classes/Extbase/AddSpecialProperties.php index e2a8d972..344713d4 100644 --- a/Classes/Extbase/AddSpecialProperties.php +++ b/Classes/Extbase/AddSpecialProperties.php @@ -1,5 +1,7 @@ connectionPool = $connectionPool; - $this->dataMapper = $dataMapper; - $qb = $this->connectionPool->getQueryBuilderForTable('tx_events_domain_model_date'); $qb->count('uid'); $qb->from('tx_events_domain_model_date'); $qb->where($qb->expr()->gt('postponed_date', $qb->createNamedParameter(0))); - $this->doPostponedDatesExist = $qb->execute()->fetchColumn() > 0; + $this->doPostponedDatesExist = $qb->executeQuery()->fetchOne() > 0; } public function __invoke(AfterObjectThawedEvent $event): void @@ -85,7 +72,7 @@ private function getOriginalDate(int $uidOfReferencedDate): ?Date $qb->where($qb->expr()->eq('postponed_date', $uidOfReferencedDate)); $qb->setMaxResults(1); - $result = $qb->execute()->fetch(); + $result = $qb->executeQuery()->fetch(); if ($result === false) { return null; diff --git a/Classes/Pagination/Factory.php b/Classes/Pagination/Factory.php index b61ca26c..b2745551 100644 --- a/Classes/Pagination/Factory.php +++ b/Classes/Pagination/Factory.php @@ -5,11 +5,11 @@ namespace WerkraumMedia\Events\Pagination; use TYPO3\CMS\Core\Pagination\PaginationInterface; +use TYPO3\CMS\Core\Pagination\SlidingWindowPagination; use TYPO3\CMS\Extbase\Pagination\QueryResultPaginator; use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; -use WerkraumMedia\Events\Backports\V12\Pagination\SlidingWindowPagination; -class Factory +final class Factory { public function create( int $currentPage, diff --git a/Classes/Service/CategoryService.php b/Classes/Service/CategoryService.php index e24c56e1..b42cb0cd 100644 --- a/Classes/Service/CategoryService.php +++ b/Classes/Service/CategoryService.php @@ -1,5 +1,7 @@ getQueryBuilderForTable('sys_category'); + ->getQueryBuilderForTable('sys_category') + ; $res = $queryBuilder ->select('uid') ->from('sys_category') @@ -74,7 +74,8 @@ protected function getChildrenCategoriesRecursive($idList, $counter = 0): string 'parent', $queryBuilder->createNamedParameter(explode(',', $idList), Connection::PARAM_INT_ARRAY) )) - ->execute(); + ->executeQuery() + ; while ($row = $res->fetch()) { if (is_array($row) === false) { @@ -96,16 +97,13 @@ protected function getChildrenCategoriesRecursive($idList, $counter = 0): string /** * Fetch ids again from DB to avoid false positives - * - * @param string $idList - * - * @return string */ protected function getUidListFromRecords(string $idList): string { $list = []; $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) - ->getQueryBuilderForTable('sys_category'); + ->getQueryBuilderForTable('sys_category') + ; $rows = $queryBuilder ->select('uid') ->from('sys_category') @@ -113,8 +111,9 @@ protected function getUidListFromRecords(string $idList): string 'uid', $queryBuilder->createNamedParameter(explode(',', $idList), Connection::PARAM_INT_ARRAY) )) - ->execute() - ->fetchAll(); + ->executeQuery() + ->fetchAll() + ; foreach ($rows as $row) { if (is_array($row) === false) { continue; diff --git a/Classes/Service/Cleanup/Database.php b/Classes/Service/Cleanup/Database.php index f675925f..4a6e6425 100644 --- a/Classes/Service/Cleanup/Database.php +++ b/Classes/Service/Cleanup/Database.php @@ -1,5 +1,7 @@ connectionPool = $connectionPool; } public function truncateTables(): void @@ -52,48 +50,46 @@ public function truncateTables(): void foreach ($tableNames as $tableName) { $this->connectionPool ->getConnectionForTable($tableName) - ->truncate($tableName); + ->truncate($tableName) + ; } $queryBuilder = $this->connectionPool->getQueryBuilderForTable('sys_category_record_mm'); - $queryBuilder->delete('sys_category_record_mm') - ->where($queryBuilder->expr()->like( - 'tablenames', - $queryBuilder->createNamedParameter('tx_events_domain_model_%') - )) - ->execute(); + $queryBuilder->delete('sys_category_record_mm')->where($queryBuilder->expr()->like( + 'tablenames', + $queryBuilder->createNamedParameter('tx_events_domain_model_%') + ))->executeStatement(); } public function deletePastDates(): void { $queryBuilder = $this->connectionPool ->getConnectionForTable(self::DATE_TABLE) - ->createQueryBuilder(); + ->createQueryBuilder() + ; $queryBuilder->getRestrictions()->removeAll(); - $midnightToday = new \DateTimeImmutable('midnight today'); - $queryBuilder->delete(self::DATE_TABLE) - ->where($queryBuilder->expr()->lte( - 'end', - $queryBuilder->createNamedParameter($midnightToday->format('U')) - )) - ->execute(); + $midnightToday = new DateTimeImmutable('midnight today'); + $queryBuilder->delete(self::DATE_TABLE)->where($queryBuilder->expr()->lte( + 'end', + $queryBuilder->createNamedParameter($midnightToday->format('U')) + ))->executeStatement(); } public function deleteEventsWithoutDates(): void { $queryBuilder = $this->connectionPool ->getConnectionForTable(self::EVENT_TABLE) - ->createQueryBuilder(); + ->createQueryBuilder() + ; $queryBuilder->getRestrictions()->removeAll(); $recordUids = $queryBuilder->select('event.uid') ->from(self::EVENT_TABLE, 'event') - ->leftJoin('event', self::DATE_TABLE, 'date', $queryBuilder->expr()->eq('date.event', 'event.uid')) - ->where($queryBuilder->expr()->isNull('date.uid')) - ->execute() - ->fetchAll(\PDO::FETCH_COLUMN); + ->leftJoin('event', self::DATE_TABLE, 'date', $queryBuilder->expr()->eq('date.event', 'event.uid'))->where($queryBuilder->expr()->isNull('date.uid'))->executeQuery() + ->fetchAll(PDO::FETCH_COLUMN) + ; $queryBuilder = $this->connectionPool->getQueryBuilderForTable(self::EVENT_TABLE); $queryBuilder->delete(self::EVENT_TABLE); @@ -101,20 +97,15 @@ public function deleteEventsWithoutDates(): void 'uid', $queryBuilder->createNamedParameter($recordUids, Connection::PARAM_INT_ARRAY) )); - $queryBuilder->execute(); + $queryBuilder->executeStatement(); $queryBuilder = $this->connectionPool->getQueryBuilderForTable('sys_category_record_mm'); - $queryBuilder->delete('sys_category_record_mm') - ->where($queryBuilder->expr()->andX( - $queryBuilder->expr()->like( - 'tablenames', - $queryBuilder->createNamedParameter('tx_events_domain_model_%') - ), - $queryBuilder->expr()->in( - 'uid_foreign', - $queryBuilder->createNamedParameter($recordUids, Connection::PARAM_INT_ARRAY) - ) - )) - ->execute(); + $queryBuilder->delete('sys_category_record_mm')->where($queryBuilder->expr()->and($queryBuilder->expr()->like( + 'tablenames', + $queryBuilder->createNamedParameter('tx_events_domain_model_%') + ), $queryBuilder->expr()->in( + 'uid_foreign', + $queryBuilder->createNamedParameter($recordUids, Connection::PARAM_INT_ARRAY) + )))->executeStatement(); } } diff --git a/Classes/Service/Cleanup/Files.php b/Classes/Service/Cleanup/Files.php index 45171ac9..d5fd9794 100644 --- a/Classes/Service/Cleanup/Files.php +++ b/Classes/Service/Cleanup/Files.php @@ -1,5 +1,7 @@ connectionPool = $connectionPool; - $this->storageRepository = $storageRepository; } public function deleteDangling(): void @@ -54,7 +45,8 @@ public function deleteDangling(): void private function markFileReferencesDeletedIfForeignRecordIsMissing(): void { $referencesQuery = $this->connectionPool - ->getQueryBuilderForTable('sys_file_reference'); + ->getQueryBuilderForTable('sys_file_reference') + ; $referencesQuery->getRestrictions()->removeAll(); $referencesQuery->select( 'uid', @@ -70,7 +62,7 @@ private function markFileReferencesDeletedIfForeignRecordIsMissing(): void ); // Remove file relations removed via import $referencesQuery->orWhere( - $referencesQuery->expr()->andX( + $referencesQuery->expr()->and( $referencesQuery->expr()->eq( 'tablenames', $referencesQuery->createNamedParameter('') @@ -92,7 +84,7 @@ private function markFileReferencesDeletedIfForeignRecordIsMissing(): void $referencesQuery->orderBy('tablenames'); $referencesQuery->addOrderBy('uid_foreign'); - $references = $referencesQuery->execute(); + $references = $referencesQuery->executeQuery(); $uidsPerTable = []; $referenceUidsToMarkAsDeleted = []; @@ -116,10 +108,13 @@ private function markFileReferencesDeletedIfForeignRecordIsMissing(): void $queryBuilder->select('uid'); $queryBuilder->from($tableName); $queryBuilder->where($queryBuilder->expr()->in('uid', $records)); - $referenceUidsToMarkAsDeleted = array_merge( - $referenceUidsToMarkAsDeleted, - array_keys(array_diff($records, $queryBuilder->execute()->fetchAll(\PDO::FETCH_COLUMN))) - ); + $referenceUidsToMarkAsDeleted = [ + ...$referenceUidsToMarkAsDeleted, + ...array_keys(array_diff( + $records, + $queryBuilder->executeQuery()->fetchAll(PDO::FETCH_COLUMN) + )), + ]; } if ($referenceUidsToMarkAsDeleted === []) { @@ -130,7 +125,7 @@ private function markFileReferencesDeletedIfForeignRecordIsMissing(): void $updateQuery->update('sys_file_reference'); $updateQuery->where($updateQuery->expr()->in('uid', $referenceUidsToMarkAsDeleted)); $updateQuery->set('deleted', '1'); - $updateQuery->execute(); + $updateQuery->executeStatement(); } private function deleteFilesWithoutProperReference(): void @@ -160,14 +155,16 @@ private function deleteFromDb(int ...$uids): void $queryBuilder = $this->connectionPool->getQueryBuilderForTable('sys_file'); $queryBuilder->delete('sys_file') ->where('uid in (:uids)') - ->setParameter(':uids', $uids, Connection::PARAM_INT_ARRAY) - ->execute(); + ->setParameter('uids', $uids, Connection::PARAM_INT_ARRAY) + ->executeStatement() + ; $queryBuilder = $this->connectionPool->getQueryBuilderForTable('sys_file_metadata'); $queryBuilder->delete('sys_file_metadata') ->where('file in (:uids)') - ->setParameter(':uids', $uids, Connection::PARAM_INT_ARRAY) - ->execute(); + ->setParameter('uids', $uids, Connection::PARAM_INT_ARRAY) + ->executeStatement() + ; $this->deleteReferences(); } @@ -179,7 +176,7 @@ private function deleteReferences(): void $queryBuilder ->delete('sys_file_reference') ->where( - $queryBuilder->expr()->orX( + $queryBuilder->expr()->or( $queryBuilder->expr()->like( 'tablenames', $queryBuilder->createNamedParameter('tx_events_domain_model_%') @@ -195,7 +192,7 @@ private function deleteReferences(): void 1 )) ; - $queryBuilder->execute(); + $queryBuilder->executeStatement(); } /** @@ -225,7 +222,7 @@ private function getPotentialFilesToDelete(): array ->groupBy('file.uid') ; - return $queryBuilder->execute()->fetchAllAssociativeIndexed(); + return $queryBuilder->executeQuery()->fetchAllAssociativeIndexed(); } /** @@ -249,13 +246,13 @@ private function filterPotentialFilesToDelete(array $files): array )) ; - foreach ($queryBuilder->execute() as $reference) { + foreach ($queryBuilder->executeQuery()->iterateAssociative() as $reference) { $file = []; $fileUid = (int)$reference['uid_local']; if ( ( - str_starts_with($reference['tablenames'], 'tx_events_domain_model_') + str_starts_with((string)$reference['tablenames'], 'tx_events_domain_model_') || $reference['tablenames'] === '' ) && $reference['deleted'] == 1 ) { diff --git a/Classes/Service/CleanupService.php b/Classes/Service/CleanupService.php index 7efb28e7..6b9c7c0d 100644 --- a/Classes/Service/CleanupService.php +++ b/Classes/Service/CleanupService.php @@ -1,26 +1,18 @@ database = $database; - $this->files = $files; + public function __construct( + private readonly Database $database, + private readonly Files $files + ) { } public function deleteAllData(): void diff --git a/Classes/Service/DataProcessingForModels.php b/Classes/Service/DataProcessingForModels.php index 15cca776..a25d9638 100644 --- a/Classes/Service/DataProcessingForModels.php +++ b/Classes/Service/DataProcessingForModels.php @@ -1,5 +1,7 @@ getPages() */ -class DataProcessingForModels implements SingletonInterface +final class DataProcessingForModels implements SingletonInterface { - /** - * @var ContentObjectRenderer - */ - private $cObject; - - /** - * @var ContentDataProcessor - */ - private $processorHandler; - - /** - * @var Connection - */ - private $connection; - - /** - * @var DataMapFactory - */ - private $dataMapFactory; + private readonly ContentObjectRenderer $cObject; - /** - * @var ConfigurationManagerInterface|null - */ - private $configurationManager; + private readonly Connection $connection; - /** - * @var TypoScriptService - */ - private $typoScriptService; + private ?ConfigurationManagerInterface $configurationManager = null; public function __construct( - ContentDataProcessor $processorHandler, + private readonly ContentDataProcessor $processorHandler, ConnectionPool $connectionPool, - DataMapFactory $dataMapFactory, - TypoScriptService $typoScriptService + private readonly DataMapFactory $dataMapFactory, + private readonly TypoScriptService $typoScriptService ) { $this->cObject = GeneralUtility::makeInstance(ContentObjectRenderer::class); - $this->processorHandler = $processorHandler; $this->connection = $connectionPool->getConnectionByName('Default'); - $this->dataMapFactory = $dataMapFactory; - $this->typoScriptService = $typoScriptService; } /** @@ -148,7 +123,7 @@ private function getData(AbstractEntity $entity): array private function getTable(AbstractEntity $entity): string { - $dataMap = $this->dataMapFactory->buildDataMap(get_class($entity)); + $dataMap = $this->dataMapFactory->buildDataMap($entity::class); return $dataMap->getTableName(); } @@ -158,7 +133,7 @@ private function getConfiguration(AbstractEntity $entity): array return []; } - $className = get_class($entity); + $className = $entity::class; $settings = $this->configurationManager->getConfiguration( ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS ); diff --git a/Classes/Service/DestinationDataImportService.php b/Classes/Service/DestinationDataImportService.php index e10e5612..ed814dbc 100644 --- a/Classes/Service/DestinationDataImportService.php +++ b/Classes/Service/DestinationDataImportService.php @@ -1,5 +1,7 @@ eventRepository = $eventRepository; - $this->organizerRepository = $organizerRepository; - $this->dateRepository = $dateRepository; - $this->configurationManager = $configurationManager; - $this->persistenceManager = $persistenceManager; - $this->objectManager = $objectManager; - $this->dataFetcher = $dataFetcher; - $this->datesFactory = $datesFactory; - $this->filesAssignment = $filesAssignment; - $this->categoriesAssignment = $categoriesAssignment; - $this->locationAssignment = $locationAssignment; - $this->slugger = $slugger; - $this->cacheManager = $cacheManager; - $this->dataHandler = $dataHandler; - $this->eventDispatcher = $eventDispatcher; } public function import( @@ -194,12 +83,12 @@ public function import( // Set Configuration $this->configurationManager->setConfiguration(array_merge($frameworkConfiguration, $persistenceConfiguration)); - $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); + $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(self::class); $this->logger->info('Starting Destination Data Import Service'); try { $data = $this->dataFetcher->fetchSearchResult($import); - } catch (Exception $e) { + } catch (Exception) { $this->logger->error('Could not receive data.'); return 1; } @@ -215,7 +104,7 @@ public function processData(array $data): int $selectedRegion = $this->import->getRegion(); foreach ($data['items'] as $event) { - $this->logger->info('Processing event ' . substr($event['title'], 0, 20)); + $this->logger->info('Processing event ' . substr((string)$event['title'], 0, 20)); // Event already exists? If not create one! $this->tmpCurrentEvent = $this->getOrCreateEvent($event['global_id'], $event['title']); @@ -230,7 +119,7 @@ public function processData(array $data): int } // Set Title - $this->tmpCurrentEvent->setTitle(substr($event['title'], 0, 254)); + $this->tmpCurrentEvent->setTitle(substr((string)$event['title'], 0, 254)); // Set Highlight (Is only set in rest if true) if ($event['highlight'] ?? false) { @@ -382,7 +271,7 @@ private function setOrganizer(array $addresses): void $this->tmpCurrentEvent->setOrganizer($tmpOrganizer); continue; } - $tmpOrganizer = $this->objectManager->get(Organizer::class); + $tmpOrganizer = GeneralUtility::makeInstance(Organizer::class); $tmpOrganizer->setLanguageUid(-1); $tmpOrganizer->setName($address['name'] ?? ''); $tmpOrganizer->setCity($address['city'] ?? ''); @@ -398,9 +287,6 @@ private function setOrganizer(array $addresses): void } } - /** - * @param array $media - */ private function setSocial(array $media): void { foreach ($media as $link) { @@ -470,13 +356,13 @@ private function setTexts(array $texts): void } if ($text['rel'] == 'details' && $text['type'] == 'text/plain') { - $this->tmpCurrentEvent->setDetails(str_replace("\n\n", "\n", $text['value'])); + $this->tmpCurrentEvent->setDetails(str_replace("\n\n", "\n", (string)$text['value'])); } if ($text['rel'] == 'teaser' && $text['type'] == 'text/plain') { - $this->tmpCurrentEvent->setTeaser(str_replace("\n\n", "\n", $text['value'])); + $this->tmpCurrentEvent->setTeaser(str_replace("\n\n", "\n", (string)$text['value'])); } if ($text['rel'] == 'PRICE_INFO' && $text['type'] == 'text/plain') { - $this->tmpCurrentEvent->setPriceInfo(str_replace("\n\n", "\n", $text['value'])); + $this->tmpCurrentEvent->setPriceInfo(str_replace("\n\n", "\n", (string)$text['value'])); } } } @@ -494,7 +380,7 @@ private function getOrCreateEvent(string $globalId, string $title): Event // New event is created $this->logger->info(substr($title, 0, 20) . ' does not exist'); - $event = $this->objectManager->get(Event::class); + $event = GeneralUtility::makeInstance(Event::class); // Create event and persist $event->setGlobalId($globalId); $this->eventRepository->add($event); diff --git a/Classes/Service/DestinationDataImportService/CategoriesAssignment.php b/Classes/Service/DestinationDataImportService/CategoriesAssignment.php index 660362de..c619aa58 100644 --- a/Classes/Service/DestinationDataImportService/CategoriesAssignment.php +++ b/Classes/Service/DestinationDataImportService/CategoriesAssignment.php @@ -1,5 +1,7 @@ repository = $repository; - $this->persistenceManager = $persistenceManager; } /** diff --git a/Classes/Service/DestinationDataImportService/CategoriesAssignment/Import.php b/Classes/Service/DestinationDataImportService/CategoriesAssignment/Import.php index 40279888..54c1cba5 100644 --- a/Classes/Service/DestinationDataImportService/CategoriesAssignment/Import.php +++ b/Classes/Service/DestinationDataImportService/CategoriesAssignment/Import.php @@ -1,41 +1,19 @@ parentCategory = $parentCategory; - $this->pid = $pid; - $this->categoryTitles = $categoryTitles; - $this->hideByDefault = $hideByDefault; } public function getParentCategory(): ?Category diff --git a/Classes/Service/DestinationDataImportService/DataFetcher.php b/Classes/Service/DestinationDataImportService/DataFetcher.php index fedce0d0..64b92d07 100644 --- a/Classes/Service/DestinationDataImportService/DataFetcher.php +++ b/Classes/Service/DestinationDataImportService/DataFetcher.php @@ -1,12 +1,15 @@ urlFactory = $urlFactory; - $this->requestFactory = $requestFactory; - $this->client = $client; - - $this->logger = $logManager->getLogger(__CLASS__); + $this->logger = $logManager->getLogger(self::class); } public function fetchSearchResult(Import $import): array @@ -76,9 +57,9 @@ public function fetchSearchResult(Import $import): array $jsonContent = $response->getBody()->__toString(); - $jsonResponse = json_decode($jsonContent, true); + $jsonResponse = json_decode($jsonContent, true, 512, JSON_THROW_ON_ERROR); if (is_array($jsonResponse) === false) { - throw new \Exception('No valid JSON fetched, got: "' . $jsonContent . '".', 1639495835); + throw new Exception('No valid JSON fetched, got: "' . $jsonContent . '".', 1639495835); } $this->logger->info('Received data with ' . count($jsonResponse['items']) . ' items'); diff --git a/Classes/Service/DestinationDataImportService/DataHandler.php b/Classes/Service/DestinationDataImportService/DataHandler.php index 0cab0ab9..39914de1 100644 --- a/Classes/Service/DestinationDataImportService/DataHandler.php +++ b/Classes/Service/DestinationDataImportService/DataHandler.php @@ -23,23 +23,20 @@ namespace WerkraumMedia\Events\Service\DestinationDataImportService; +use Psr\Log\LoggerInterface; use TYPO3\CMS\Core\DataHandling\DataHandler as Typo3DataHandler; -use TYPO3\CMS\Core\Log\Logger; use TYPO3\CMS\Core\Log\LogManager; use TYPO3\CMS\Core\Utility\GeneralUtility; use WerkraumMedia\Events\Service\DestinationDataImportService\DataHandler\Assignment; final class DataHandler { - /** - * @var Logger - */ - private $logger; + private readonly LoggerInterface $logger; public function __construct( LogManager $logManager ) { - $this->logger = $logManager->getLogger(__CLASS__); + $this->logger = $logManager->getLogger(self::class); } public function storeAssignments( diff --git a/Classes/Service/DestinationDataImportService/DataHandler/Assignment.php b/Classes/Service/DestinationDataImportService/DataHandler/Assignment.php index 9202b0d3..1560c849 100644 --- a/Classes/Service/DestinationDataImportService/DataHandler/Assignment.php +++ b/Classes/Service/DestinationDataImportService/DataHandler/Assignment.php @@ -28,31 +28,26 @@ final class Assignment { - /** - * @var int - */ - private $uid; - - /** - * @var string - */ - private $columnName; + private readonly int $uid; /** * @var int[] */ - private $uids; + private readonly array $uids; /** * @param AbstractDomainObject[] $assignments */ public function __construct( - int $uid, - string $columnName, + ?int $uid, + private readonly string $columnName, array $assignments ) { + if (is_int($uid) === false) { + throw new InvalidArgumentException('Only integer allowed as uid, need a persisted entity.', 1699352008); + } + $this->uid = $uid; - $this->columnName = $columnName; $this->uids = array_map(static function (AbstractDomainObject $model): int { $uid = $model->getUid(); if (is_int($uid) === false) { diff --git a/Classes/Service/DestinationDataImportService/DatesFactory.php b/Classes/Service/DestinationDataImportService/DatesFactory.php index ea470876..c3fee266 100644 --- a/Classes/Service/DestinationDataImportService/DatesFactory.php +++ b/Classes/Service/DestinationDataImportService/DatesFactory.php @@ -1,50 +1,42 @@ context = $context; - $this->configurationManager = $configurationManager; - $this->logger = $logManager->getLogger(__CLASS__); + $this->logger = $logManager->getLogger(self::class); } /** - * @return \Generator + * @return Generator */ public function createDates( array $timeIntervals, bool $canceled - ): \Generator { + ): Generator { foreach ($timeIntervals as $date) { $dates = $this->createDate($date, $canceled); - if (!$dates instanceof \Generator) { + if (!$dates instanceof Generator) { return null; } @@ -55,12 +47,12 @@ public function createDates( } /** - * @return \Generator|null + * @return Generator|null */ private function createDate( array $date, bool $canceled - ): ?\Generator { + ): ?Generator { if ($this->isDateSingleDate($date)) { $this->logger->info('Is single date', ['date' => $date]); return $this->createSingleDate($date, $canceled); @@ -99,24 +91,24 @@ private function isDateInterval(array $date): bool } /** - * @return \Generator + * @return Generator */ private function createSingleDate( array $date, bool $canceled - ): \Generator { - if (new \DateTimeImmutable($date['start']) > $this->getToday()) { + ): Generator { + if (new DateTimeImmutable($date['start']) > $this->getToday()) { yield Date::createFromDestinationDataDate($date, $canceled); } } /** - * @return \Generator|null + * @return Generator|null */ private function createDateFromInterval( array $date, bool $canceled - ): ?\Generator { + ): ?Generator { $date = $this->ensureRepeatUntil($date); if ($date['freq'] == 'Daily') { @@ -149,19 +141,19 @@ private function ensureRepeatUntil(array $date): array } /** - * @return \Generator + * @return Generator */ private function createDailyDates( array $date, bool $canceled - ): \Generator { + ): Generator { $today = $this->getToday(); - $timeZone = new \DateTimeZone($date['tz']); - $start = new \DateTimeImmutable($date['start'], $timeZone); - $end = new \DateTimeImmutable($date['end'], $timeZone); - $until = new \DateTimeImmutable($date['repeatUntil'], $timeZone); + $timeZone = new DateTimeZone($date['tz']); + $start = new DateTimeImmutable($date['start'], $timeZone); + $end = new DateTimeImmutable($date['end'], $timeZone); + $until = new DateTimeImmutable($date['repeatUntil'], $timeZone); - $period = new \DatePeriod($start, new \DateInterval('P1D'), $until); + $period = new DatePeriod($start, new DateInterval('P1D'), $until); foreach ($period as $day) { $day = $day->setTimezone($timeZone); if ($day < $today) { @@ -179,23 +171,23 @@ private function createDailyDates( } /** - * @return \Generator + * @return Generator */ private function createWeeklyDates( array $date, bool $canceled - ): \Generator { + ): Generator { $today = $this->getToday(); - $timeZone = new \DateTimeZone($date['tz']); - $start = new \DateTimeImmutable($date['start'], $timeZone); - $end = new \DateTimeImmutable($date['end'], $timeZone); - $until = new \DateTimeImmutable($date['repeatUntil'], $timeZone); + $timeZone = new DateTimeZone($date['tz']); + $start = new DateTimeImmutable($date['start'], $timeZone); + $end = new DateTimeImmutable($date['end'], $timeZone); + $until = new DateTimeImmutable($date['repeatUntil'], $timeZone); foreach ($date['weekdays'] as $day) { $dateToUse = $start->modify($day); $dateToUse = $dateToUse->setTime((int)$start->format('H'), (int)$start->format('i')); - $period = new \DatePeriod($dateToUse, new \DateInterval('P1W'), $until); + $period = new DatePeriod($dateToUse, new DateInterval('P1W'), $until); foreach ($period as $day) { $day = $day->setTimezone($timeZone); if ($day < $today) { @@ -214,9 +206,9 @@ private function createWeeklyDates( } private function createDateFromStartAndEnd( - \DateTimeImmutable $dateToUse, - \DateTimeImmutable $start, - \DateTimeImmutable $end, + DateTimeImmutable $dateToUse, + DateTimeImmutable $start, + DateTimeImmutable $end, bool $canceled ): Date { return Date::createFromDestinationData( @@ -226,11 +218,11 @@ private function createDateFromStartAndEnd( ); } - private function getToday(): \DateTimeImmutable + private function getToday(): DateTimeImmutable { - $today = $this->context->getPropertyFromAspect('date', 'full', new \DateTimeImmutable()); - if (!$today instanceof \DateTimeImmutable) { - $today = new \DateTimeImmutable(); + $today = $this->context->getPropertyFromAspect('date', 'full', new DateTimeImmutable()); + if (!$today instanceof DateTimeImmutable) { + $today = new DateTimeImmutable(); } return $today->modify('midnight'); diff --git a/Classes/Service/DestinationDataImportService/Events/CategoriesAssignEvent.php b/Classes/Service/DestinationDataImportService/Events/CategoriesAssignEvent.php index fcc4a2fa..79cdd479 100644 --- a/Classes/Service/DestinationDataImportService/Events/CategoriesAssignEvent.php +++ b/Classes/Service/DestinationDataImportService/Events/CategoriesAssignEvent.php @@ -29,24 +29,18 @@ final class CategoriesAssignEvent { - /** - * @var Event - */ - private $event; - /** * @var ObjectStorage */ - private $categories; + private ObjectStorage $categories; /** * @param ObjectStorage $categories */ public function __construct( - Event $event, + private readonly Event $event, ObjectStorage $categories ) { - $this->event = $event; $this->setCategories($categories); } diff --git a/Classes/Service/DestinationDataImportService/Events/EventImportEvent.php b/Classes/Service/DestinationDataImportService/Events/EventImportEvent.php index afb9c454..00bc68f2 100644 --- a/Classes/Service/DestinationDataImportService/Events/EventImportEvent.php +++ b/Classes/Service/DestinationDataImportService/Events/EventImportEvent.php @@ -27,22 +27,10 @@ final class EventImportEvent { - /** - * @var Event - */ - private $existingEvent; - - /** - * @var Event - */ - private $eventToImport; - public function __construct( - Event $existingEvent, - Event $eventToImport + private readonly Event $existingEvent, + private readonly Event $eventToImport ) { - $this->existingEvent = $existingEvent; - $this->eventToImport = $eventToImport; } public function getBaseEvent(): Event diff --git a/Classes/Service/DestinationDataImportService/FilesAssignment.php b/Classes/Service/DestinationDataImportService/FilesAssignment.php index 26853fb4..d6e4a3a2 100644 --- a/Classes/Service/DestinationDataImportService/FilesAssignment.php +++ b/Classes/Service/DestinationDataImportService/FilesAssignment.php @@ -25,6 +25,7 @@ use Exception; use Psr\Log\LoggerInterface; +use SplFileInfo; use TYPO3\CMS\Core\Log\LogManager; use TYPO3\CMS\Core\Resource\DuplicationBehavior; use TYPO3\CMS\Core\Resource\File; @@ -36,38 +37,17 @@ use WerkraumMedia\Events\Domain\Model\Event; use WerkraumMedia\Events\Domain\Model\Import; -class FilesAssignment +final class FilesAssignment { - /** - * @var LoggerInterface - */ - private $logger; - - /** - * @var DataFetcher - */ - private $dataFetcher; - - /** - * @var ResourceFactory - */ - private $resourceFactory; - - /** - * @var MetaDataRepository - */ - private $metaDataRepository; + private readonly LoggerInterface $logger; public function __construct( LogManager $logManager, - DataFetcher $dataFetcher, - ResourceFactory $resourceFactory, - MetaDataRepository $metaDataRepository + private readonly DataFetcher $dataFetcher, + private readonly ResourceFactory $resourceFactory, + private readonly MetaDataRepository $metaDataRepository ) { $this->logger = $logManager->getLogger(self::class); - $this->dataFetcher = $dataFetcher; - $this->resourceFactory = $resourceFactory; - $this->metaDataRepository = $metaDataRepository; } /** @@ -86,7 +66,7 @@ public function getImages( continue; } - $fileUrl = urldecode($mediaObject['url']); + $fileUrl = urldecode((string)$mediaObject['url']); $orgFileNameSanitized = $importFolder->getStorage()->sanitizeFileName(basename($fileUrl)); $this->logger->info('File attached.', [$fileUrl, $orgFileNameSanitized]); @@ -124,7 +104,7 @@ private function loadFile(string $fileUrl): string try { $response = $this->dataFetcher->fetchImage($fileUrl); - } catch (Exception $e) { + } catch (Exception) { $this->logger->error('Cannot load file.', [$fileUrl]); return ''; } @@ -134,7 +114,7 @@ private function loadFile(string $fileUrl): string return ''; } - $file = new \SplFileInfo($fileUrl); + $file = new SplFileInfo($fileUrl); $temporaryFilename = GeneralUtility::tempnam($file->getBasename()); $writeResult = GeneralUtility::writeFile($temporaryFilename, $response->getBody()->__toString(), true); if ($writeResult === false) { @@ -204,7 +184,6 @@ private function isImage(array $mediaObject): bool ]; return ((string)$mediaObject['rel']) === 'default' - && in_array($mediaObject['type'], $allowedMimeTypes) - ; + && in_array($mediaObject['type'], $allowedMimeTypes); } } diff --git a/Classes/Service/DestinationDataImportService/LocationAssignment.php b/Classes/Service/DestinationDataImportService/LocationAssignment.php index d3d201d5..a0c94122 100644 --- a/Classes/Service/DestinationDataImportService/LocationAssignment.php +++ b/Classes/Service/DestinationDataImportService/LocationAssignment.php @@ -1,21 +1,17 @@ repository = $repository; } public function getLocation(array $event): ?Location @@ -28,8 +24,8 @@ public function getLocation(array $event): ?Location $event['district'] ?? '', $event['country'] ?? '', $event['phone'] ?? '', - $event['geo']['main']['latitude'] ?? '', - $event['geo']['main']['longitude'] ?? '', + (string)($event['geo']['main']['latitude'] ?? ''), + (string)($event['geo']['main']['longitude'] ?? ''), -1 ); diff --git a/Classes/Service/DestinationDataImportService/Slugger.php b/Classes/Service/DestinationDataImportService/Slugger.php index 05bef3f8..2a068b15 100644 --- a/Classes/Service/DestinationDataImportService/Slugger.php +++ b/Classes/Service/DestinationDataImportService/Slugger.php @@ -23,6 +23,8 @@ namespace WerkraumMedia\Events\Service\DestinationDataImportService; +use Generator; +use PDO; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\QueryBuilder; use TYPO3\CMS\Core\DataHandling\SlugHelper; @@ -30,24 +32,12 @@ use WerkraumMedia\Events\Service\DestinationDataImportService\Slugger\Registry; use WerkraumMedia\Events\Service\DestinationDataImportService\Slugger\SluggerType; -class Slugger +final class Slugger { - /** - * @var Registry - */ - private $registry; - - /** - * @var ConnectionPool - */ - private $connectionPool; - public function __construct( - Registry $registry, - ConnectionPool $connectionPool + private readonly Registry $registry, + private readonly ConnectionPool $connectionPool ) { - $this->registry = $registry; - $this->connectionPool = $connectionPool; } public function update(string $tableName): void @@ -59,9 +49,9 @@ public function update(string $tableName): void } /** - * @return \Generator + * @return Generator */ - private function getRecords(SluggerType $sluggerType): \Generator + private function getRecords(SluggerType $sluggerType): Generator { $tableName = $sluggerType->getSupportedTableName(); $slugColumn = $sluggerType->getSlugColumn(); @@ -70,12 +60,13 @@ private function getRecords(SluggerType $sluggerType): \Generator $statement = $queryBuilder->select('*') ->from($tableName) ->where( - $queryBuilder->expr()->orX( - $queryBuilder->expr()->eq($slugColumn, $queryBuilder->createNamedParameter('', \PDO::PARAM_STR)), + $queryBuilder->expr()->or( + $queryBuilder->expr()->eq($slugColumn, $queryBuilder->createNamedParameter('', PDO::PARAM_STR)), $queryBuilder->expr()->isNull($slugColumn) ) ) - ->execute(); + ->executeQuery() + ; while ($record = $statement->fetch()) { if (is_array($record) === false) { @@ -97,11 +88,12 @@ private function updateRecord(SluggerType $sluggerType, array $record): void ->where( $queryBuilder->expr()->eq( 'uid', - $queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT) + $queryBuilder->createNamedParameter($record['uid'], PDO::PARAM_INT) ) ) - ->set($sluggerType->getSlugColumn(), $slug); - $queryBuilder->execute(); + ->set($sluggerType->getSlugColumn(), $slug) + ; + $queryBuilder->executeStatement(); } private function getSlugHelper( diff --git a/Classes/Service/DestinationDataImportService/Slugger/Date.php b/Classes/Service/DestinationDataImportService/Slugger/Date.php index 2ffd0fa9..4556c1da 100644 --- a/Classes/Service/DestinationDataImportService/Slugger/Date.php +++ b/Classes/Service/DestinationDataImportService/Slugger/Date.php @@ -23,24 +23,19 @@ namespace WerkraumMedia\Events\Service\DestinationDataImportService\Slugger; +use DateTimeImmutable; use TYPO3\CMS\Core\Database\ConnectionPool; -class Date implements SluggerType +final class Date implements SluggerType { - /** - * @var ConnectionPool - */ - private $connectionPool; - public function __construct( - ConnectionPool $connectionPool + private readonly ConnectionPool $connectionPool ) { - $this->connectionPool = $connectionPool; } public function prepareRecordForSlugGeneration(array $record): array { - $start = new \DateTimeImmutable('@' . $record['start']); + $start = new DateTimeImmutable('@' . $record['start']); $record['event-title'] = $this->getEventTitle((int)$record['event']); $record['start'] = $start->format('Y-m-d'); @@ -64,7 +59,7 @@ private function getEventTitle(int $eventUid): string $qb->select('title'); $qb->from('tx_events_domain_model_event'); $qb->where($qb->expr()->eq('uid', $eventUid)); - $title = $qb->execute()->fetchOne(); + $title = $qb->executeQuery()->fetchOne(); if (is_string($title)) { return $title; } diff --git a/Classes/Service/DestinationDataImportService/Slugger/Event.php b/Classes/Service/DestinationDataImportService/Slugger/Event.php index 984534f7..4639f7f6 100644 --- a/Classes/Service/DestinationDataImportService/Slugger/Event.php +++ b/Classes/Service/DestinationDataImportService/Slugger/Event.php @@ -23,7 +23,7 @@ namespace WerkraumMedia\Events\Service\DestinationDataImportService\Slugger; -class Event implements SluggerType +final class Event implements SluggerType { public function prepareRecordForSlugGeneration(array $record): array { diff --git a/Classes/Service/DestinationDataImportService/Slugger/Registry.php b/Classes/Service/DestinationDataImportService/Slugger/Registry.php index 8719315b..598a3e58 100644 --- a/Classes/Service/DestinationDataImportService/Slugger/Registry.php +++ b/Classes/Service/DestinationDataImportService/Slugger/Registry.php @@ -23,17 +23,19 @@ namespace WerkraumMedia\Events\Service\DestinationDataImportService\Slugger; -class Registry +use Exception; + +final class Registry { /** * @var SluggerType[] */ - private $sluggers = []; + private array $sluggers = []; public function get(string $tableName): SluggerType { if (!isset($this->sluggers[$tableName])) { - throw new \Exception( + throw new Exception( sprintf( 'No slugger registered for table "%s", only for tables: "%s".', $tableName, diff --git a/Classes/Service/DestinationDataImportService/UrlFactory.php b/Classes/Service/DestinationDataImportService/UrlFactory.php index 6a2831f7..70117f5f 100644 --- a/Classes/Service/DestinationDataImportService/UrlFactory.php +++ b/Classes/Service/DestinationDataImportService/UrlFactory.php @@ -1,16 +1,17 @@ settings = $configurationManager->getConfiguration( - ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, 'Events', 'Pi1' - )['destinationData'] ?? []; + )['settings']['destinationData'] ?? []; } /** diff --git a/Classes/Testing/TypoScriptInstructionModifier.php b/Classes/Testing/TypoScriptInstructionModifier.php deleted file mode 100644 index ea6c9c86..00000000 --- a/Classes/Testing/TypoScriptInstructionModifier.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -namespace WerkraumMedia\Events\Testing; - -use TYPO3\CMS\Core\SingletonInterface; -use TYPO3\CMS\Core\TypoScript\TemplateService; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\Hook\TypoScriptInstructionModifier as Typo3TypoScriptInstructionModifier; -use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\RequestBootstrap; - -/** - * Wrap original code to check whether internal request exists. - * It does not exist during import. - * - * No PR upstream as this is probably an unusual use case. - * But we call frontend, import, frontend so have a mix. - */ -class TypoScriptInstructionModifier implements SingletonInterface -{ - public function apply(array $parameters, TemplateService $service): void - { - $request = RequestBootstrap::getInternalRequest(); - if ($request === null) { - return; - } - - GeneralUtility::callUserFunction( - Typo3TypoScriptInstructionModifier::class . '->apply', - $parameters, - $service - ); - } -} diff --git a/Classes/Updates/MigrateDuplicateLocations.php b/Classes/Updates/MigrateDuplicateLocations.php index 875545bb..e7fbf0c7 100644 --- a/Classes/Updates/MigrateDuplicateLocations.php +++ b/Classes/Updates/MigrateDuplicateLocations.php @@ -26,20 +26,16 @@ use Generator; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Install\Attribute\UpgradeWizard; use TYPO3\CMS\Install\Updates\UpgradeWizardInterface; use WerkraumMedia\Events\Domain\Model\Location; +#[UpgradeWizard(MigrateDuplicateLocations::class)] final class MigrateDuplicateLocations implements UpgradeWizardInterface { - /** - * @var ConnectionPool - */ - private $connectionPool; - public function __construct( - ConnectionPool $connectionPool + private readonly ConnectionPool $connectionPool ) { - $this->connectionPool = $connectionPool; } public function getIdentifier(): string @@ -98,11 +94,6 @@ public function getPrerequisites(): array return []; } - public static function register(): void - { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][self::class] = self::class; - } - /** * @return Generator */ @@ -125,7 +116,7 @@ private function getLocations(): Generator ); $queryBuilder->from('tx_events_domain_model_location'); $queryBuilder->orderBy('uid', 'asc'); - $result = $queryBuilder->execute(); + $result = $queryBuilder->executeQuery(); foreach ($result->fetchAllAssociative() as $location) { yield $location; @@ -143,7 +134,7 @@ private function getMatchingLocation( $queryBuilder->andWhere($queryBuilder->expr()->neq('uid', $queryBuilder->createNamedParameter($uid))); $queryBuilder->setMaxResults(1); - $uid = $queryBuilder->execute()->fetchOne(); + $uid = $queryBuilder->executeQuery()->fetchOne(); if (is_numeric($uid) === false) { return 0; } @@ -175,7 +166,7 @@ private function updateLocation(Location $location, int $uid): void $queryBuilder->set('global_id', $location->getGlobalId()); $queryBuilder->set('latitude', $location->getLatitude()); $queryBuilder->set('longitude', $location->getLongitude()); - $queryBuilder->execute(); + $queryBuilder->executeStatement(); } /** @@ -186,7 +177,7 @@ private function removeDuplicates(array $uids): void $queryBuilder = $this->connectionPool->getQueryBuilderForTable('tx_events_domain_model_location'); $queryBuilder->delete('tx_events_domain_model_location'); $queryBuilder->where($queryBuilder->expr()->in('uid', $queryBuilder->createNamedParameter($uids, Connection::PARAM_INT_ARRAY))); - $queryBuilder->execute(); + $queryBuilder->executeStatement(); } private function updateRelations(array $migration): void @@ -198,7 +189,7 @@ private function updateRelations(array $migration): void $finalBuilder = clone $queryBuilder; $finalBuilder->where($finalBuilder->expr()->eq('location', $finalBuilder->createNamedParameter($legacyLocationUid))); $finalBuilder->set('location', $newLocationUid); - $finalBuilder->execute(); + $finalBuilder->executeStatement(); } } } diff --git a/Classes/Updates/MigrateOldLocations.php b/Classes/Updates/MigrateOldLocations.php index ad28e0ed..a1705ad3 100644 --- a/Classes/Updates/MigrateOldLocations.php +++ b/Classes/Updates/MigrateOldLocations.php @@ -23,43 +23,28 @@ namespace WerkraumMedia\Events\Updates; +use Exception; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\QueryBuilder; use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\Log\Logger; use TYPO3\CMS\Core\Log\LogManager; +use TYPO3\CMS\Install\Attribute\UpgradeWizard; use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite; use TYPO3\CMS\Install\Updates\UpgradeWizardInterface; +#[UpgradeWizard(MigrateOldLocations::class)] class MigrateOldLocations implements UpgradeWizardInterface { - /** - * @var ConnectionPool - */ - private $connectionPool; - - /** - * @var DataHandler - */ - private $dataHandler; + private readonly Logger $logger; - /** - * @var Logger - */ - private $logger; - - /** - * @var array - */ - private $uidsForTranslation = []; + private array $uidsForTranslation = []; public function __construct( - ConnectionPool $connectionPool, - DataHandler $dataHandler, + private readonly ConnectionPool $connectionPool, + private readonly DataHandler $dataHandler, LogManager $logManager ) { - $this->connectionPool = $connectionPool; - $this->dataHandler = $dataHandler; $this->logger = $logManager->getLogger(self::class); } @@ -76,16 +61,12 @@ public function getDescription(): string public function updateNecessary(): bool { return $this->hasOldColumns() - && $this->getQueryBuilder() - ->count('*') - ->execute() - ->fetchOne() > 0 - ; + && $this->getQueryBuilder()->count('*')->executeQuery()->fetchOne() > 0; } public function executeUpdate(): bool { - $result = $this->getQueryBuilder()->execute(); + $result = $this->getQueryBuilder()->executeQuery()->iterateAssociative(); foreach ($result as $eventRecord) { $this->logger->info('Updating event record.', ['record' => $eventRecord]); $eventRecord['location'] = $this->getLocationUid($eventRecord); @@ -127,7 +108,7 @@ private function getExitingLocationUid(array $event): int $qb->andWhere($qb->expr()->eq($column, $qb->createNamedParameter($event[$column]))); } - $uids = $qb->execute()->fetchAssociative(); + $uids = $qb->executeQuery()->fetchAssociative(); if (is_bool($uids)) { return 0; } @@ -203,7 +184,7 @@ private function createLocation(array $event): int return $l10nParentUid; } - throw new \Exception('Could not create location: ' . implode(', ', $dataHandler->errorLog), 1672916613); + throw new Exception('Could not create location: ' . implode(', ', $dataHandler->errorLog), 1672916613); } private function updateEvent(array $event): void @@ -255,7 +236,8 @@ private function hasOldColumns(): bool ->getConnectionForTable('tx_events_domain_model_event') ->getSchemaManager() ->createSchema() - ->getTable('tx_events_domain_model_event'); + ->getTable('tx_events_domain_model_event') + ; foreach ($this->columnsToFetch() as $column) { if ($schema->hasColumn($column) === false) { @@ -283,9 +265,4 @@ private function columnsToFetch(): array 'longitude', ]; } - - public static function register(): void - { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][self::class] = self::class; - } } diff --git a/Configuration/Extbase/Persistence/Classes.php b/Configuration/Extbase/Persistence/Classes.php index 6b1a5119..26d228bd 100644 --- a/Configuration/Extbase/Persistence/Classes.php +++ b/Configuration/Extbase/Persistence/Classes.php @@ -2,8 +2,10 @@ declare(strict_types=1); +use WerkraumMedia\Events\Domain\Model\Category; + return [ - \WerkraumMedia\Events\Domain\Model\Category::class => [ + Category::class => [ 'tableName' => 'sys_category', ], ]; diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index b3020fba..a5090de9 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -48,3 +48,6 @@ services: - name: event.listener event: WerkraumMedia\Events\Events\Controller\DateListVariables method: 'trackDates' + - name: event.listener + event: TYPO3\CMS\Frontend\Event\ModifyCacheLifetimeForPageEvent + method: 'modifyCacheLifetimeForPage' diff --git a/Configuration/TCA/Overrides/pages.php b/Configuration/TCA/Overrides/pages.php index 280da377..69a24001 100644 --- a/Configuration/TCA/Overrides/pages.php +++ b/Configuration/TCA/Overrides/pages.php @@ -1,11 +1,16 @@ [ 'typeicon_classes' => [ 'contains-events' => 'pages-module-events', @@ -13,13 +18,13 @@ ], ]); - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem( + ExtensionManagementUtility::addTcaSelectItem( $tableName, 'module', [ - 0 => $languagePath . '.module.events', - 1 => 'events', - 2 => 'pages-module-events', + 'label' => $languagePath . '.module.events', + 'value' => 'events', + 'icon' => 'pages-module-events', ] ); })('events', 'pages'); diff --git a/Configuration/TCA/Overrides/sys_category.php b/Configuration/TCA/Overrides/sys_category.php index 9a3949a0..f728edba 100644 --- a/Configuration/TCA/Overrides/sys_category.php +++ b/Configuration/TCA/Overrides/sys_category.php @@ -1,7 +1,11 @@ [ 'sorting' => [ 'config' => [ diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php index d42767b4..d50c2bfb 100644 --- a/Configuration/TCA/Overrides/sys_template.php +++ b/Configuration/TCA/Overrides/sys_template.php @@ -1,9 +1,13 @@ 'Categories', - 'fieldConfiguration' => [ - 'minitems' => 0, - 'multiple' => true, - ], - ] - ); - - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable( - $extKey, - $table, - 'features', - [ - 'label' => 'Features', - 'fieldConfiguration' => [ - 'minitems' => 0, - 'multiple' => true, - ], - ] - ); -})('events', 'tx_events_domain_model_event'); diff --git a/Configuration/TCA/tx_events_domain_model_date.php b/Configuration/TCA/tx_events_domain_model_date.php index 6f1b6b71..6497691f 100644 --- a/Configuration/TCA/tx_events_domain_model_date.php +++ b/Configuration/TCA/tx_events_domain_model_date.php @@ -1,5 +1,7 @@ [ 'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date', @@ -8,7 +10,6 @@ 'label_alt_force' => true, 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'versioningWS' => true, 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', @@ -29,19 +30,7 @@ 'sys_language_uid' => [ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', - 'config' => [ - 'type' => 'select', - 'renderType' => 'selectSingle', - 'special' => 'languages', - 'items' => [ - [ - 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', - -1, - 'flags-multiple', - ], - ], - 'default' => 0, - ], + 'config' => ['type' => 'language'], ], 'l10n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', @@ -51,7 +40,7 @@ 'renderType' => 'selectSingle', 'default' => 0, 'items' => [ - ['', 0], + ['label' => '', 'value' => 0], ], 'foreign_table' => 'tx_events_domain_model_date', 'foreign_table_where' => 'AND {#tx_events_domain_model_date}.{#pid}=###CURRENT_PID### AND {#tx_events_domain_model_date}.{#sys_language_uid} IN (-1,0)', @@ -78,8 +67,7 @@ 'renderType' => 'checkboxToggle', 'items' => [ [ - 0 => '', - 1 => '', + 'label' => '', 'invertStateDisplay' => true, ], ], @@ -89,10 +77,8 @@ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', - 'eval' => 'datetime,int', - 'default' => 0, + 'type' => 'datetime', + 'format' => 'datetime', 'behaviour' => [ 'allowLanguageSynchronization' => true, ], @@ -102,13 +88,8 @@ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', - 'eval' => 'datetime,int', - 'default' => 0, - 'range' => [ - 'upper' => mktime(0, 0, 0, 1, 1, 2038), - ], + 'type' => 'datetime', + 'format' => 'datetime', 'behaviour' => [ 'allowLanguageSynchronization' => true, ], @@ -119,11 +100,9 @@ 'exclude' => true, 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.start', 'config' => [ - //'dbType' => 'datetime', - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', + 'format' => 'datetime', 'size' => 12, - 'eval' => 'datetime', 'default' => null, ], ], @@ -131,11 +110,9 @@ 'exclude' => true, 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.end', 'config' => [ - //'dbType' => 'datetime', - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', + 'format' => 'datetime', 'size' => 12, - 'eval' => 'datetime', 'default' => null, ], ], @@ -148,16 +125,16 @@ 'default' => 'no', 'items' => [ '0' => [ - '0' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled.options.no', - '1' => 'no', + 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled.options.no', + 'value' => 'no', ], '1' => [ - '0' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled.options.canceled', - '1' => 'canceled', + 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled.options.canceled', + 'value' => 'canceled', ], '2' => [ - '0' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled.options.postponed', - '1' => 'postponed', + 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled.options.postponed', + 'value' => 'postponed', ], ], ], @@ -174,8 +151,8 @@ 'default' => '0', 'items' => [ '0' => [ - '0' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.postponed_date.0', - '1' => '0', + 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.postponed_date.0', + 'value' => '0', ], ], ], @@ -185,18 +162,7 @@ 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled_link', 'displayCond' => 'FIELD:canceled:=:canceled', 'config' => [ - 'type' => 'input', - 'softref' => 'typolink', - 'renderType' => 'inputLink', - 'max' => 1024, - 'eval' => 'trim', - 'fieldControl' => [ - 'linkPopup' => [ - 'options' => [ - 'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_link_formlabel', - ], - ], - ], + 'type' => 'link', ], ], 'slug' => [ diff --git a/Configuration/TCA/tx_events_domain_model_event.php b/Configuration/TCA/tx_events_domain_model_event.php index 39c185e0..5870b496 100644 --- a/Configuration/TCA/tx_events_domain_model_event.php +++ b/Configuration/TCA/tx_events_domain_model_event.php @@ -1,7 +1,11 @@ 'title', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'versioningWS' => true, 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', @@ -78,19 +81,7 @@ 'sys_language_uid' => [ 'exclude' => true, 'label' => $l10nPathGeneral . ':LGL.language', - 'config' => [ - 'type' => 'select', - 'renderType' => 'selectSingle', - 'special' => 'languages', - 'items' => [ - [ - $l10nPathGeneral . ':LGL.allLanguages', - -1, - 'flags-multiple', - ], - ], - 'default' => 0, - ], + 'config' => ['type' => 'language'], ], 'l10n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', @@ -100,7 +91,7 @@ 'renderType' => 'selectSingle', 'default' => 0, 'items' => [ - ['', 0], + ['label' => '', 'value' => 0], ], 'foreign_table' => 'tx_events_domain_model_event', 'foreign_table_where' => 'AND {#tx_events_domain_model_event}.{#pid}=###CURRENT_PID### AND {#tx_events_domain_model_event}.{#sys_language_uid} IN (-1,0)', @@ -127,8 +118,7 @@ 'renderType' => 'checkboxToggle', 'items' => [ [ - 0 => '', - 1 => '', + 'label' => '', 'invertStateDisplay' => true, ], ], @@ -138,10 +128,8 @@ 'exclude' => true, 'label' => $l10nPathGeneral . ':LGL.starttime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', - 'eval' => 'datetime,int', - 'default' => 0, + 'type' => 'datetime', + 'format' => 'datetime', 'behaviour' => [ 'allowLanguageSynchronization' => true, ], @@ -151,13 +139,8 @@ 'exclude' => true, 'label' => $l10nPathGeneral . ':LGL.endtime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', - 'eval' => 'datetime,int', - 'default' => 0, - 'range' => [ - 'upper' => mktime(0, 0, 0, 1, 1, 2038), - ], + 'type' => 'datetime', + 'format' => 'datetime', 'behaviour' => [ 'allowLanguageSynchronization' => true, ], @@ -205,9 +188,7 @@ 'exclude' => true, 'label' => $l10nPath . ':tx_events_domain_model_event.source_url', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputLink', - 'softref' => 'typolink', + 'type' => 'link', 'readOnly' => true, ], ], @@ -235,8 +216,7 @@ 'renderType' => 'checkboxToggle', 'items' => [ [ - 0 => '', - 1 => '', + 'label' => '', 'invertStateDisplay' => false, ], ], @@ -293,12 +273,8 @@ 'exclude' => true, 'label' => $l10nPath . ':tx_events_domain_model_event.ticket', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputLink', - 'eval' => 'trim', - 'max' => 1024, + 'type' => 'link', 'size' => 50, - 'softref' => 'typolink', ], ], 'facebook' => [ @@ -331,57 +307,27 @@ 'images' => [ 'exclude' => true, 'label' => $l10nPath . ':tx_events_domain_model_event.images', - 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( - 'images', - [ - 'appearance' => [ - 'createNewRelationLinkTitle' => $l10nPathFE . ':images.addFileReference', - 'showPossibleLocalizationRecords' => true, - 'showRemovedLocalizationRecords' => true, - 'showAllLocalizationLink' => true, - 'showSynchronizationLink' => true, - ], - 'foreign_match_fields' => [ - 'fieldname' => 'images', - 'tablenames' => 'tx_events_domain_model_event', - 'table_local' => 'sys_file', - ], - 'foreign_types' => [ + 'config' => [ + 'type' => 'file', + 'maxitems' => 8, + 'allowed' => 'common-image-types', + // custom configuration for displaying fields in the overlay/reference table + // to use the imageoverlayPalette instead of the basicoverlayPalette + 'overrideChildTca' => [ + 'types' => [ '0' => [ 'showitem' => ' - --palette--;' . $l10nPathFE . ':sys_file_reference.imageoverlayPalette;imageoverlayPalette, - --palette--;;filePalette', - ], - \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ - 'showitem' => ' - --palette--;' . $l10nPathFE . ':sys_file_reference.imageoverlayPalette;imageoverlayPalette, - --palette--;;filePalette', - ], - \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ - 'showitem' => ' - --palette--;' . $l10nPathFE . ':sys_file_reference.imageoverlayPalette;imageoverlayPalette, - --palette--;;filePalette', - ], - \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ - 'showitem' => ' - --palette--;' . $l10nPathFE . ':sys_file_reference.imageoverlayPalette;imageoverlayPalette, - --palette--;;filePalette', + --palette--;;imageoverlayPalette, + --palette--;;filePalette', ], - \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + File::FILETYPE_IMAGE => [ 'showitem' => ' - --palette--;' . $l10nPathFE . ':sys_file_reference.imageoverlayPalette;imageoverlayPalette, - --palette--;;filePalette', - ], - \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ - 'showitem' => ' - --palette--;' . $l10nPathFE . ':sys_file_reference.imageoverlayPalette;imageoverlayPalette, - --palette--;;filePalette', + --palette--;;imageoverlayPalette, + --palette--;;filePalette', ], ], - 'maxitems' => 8, ], - $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] - ), + ], ], 'pages' => [ @@ -389,16 +335,27 @@ 'label' => $l10nPath . ':tx_events_domain_model_event.pages', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'allowed' => 'pages', ], ], 'categories' => [ 'exclude' => true, + 'label' => 'Categories', + 'config' => [ + 'type' => 'category', + 'minitems' => 0, + 'multiple' => true, + ], ], 'features' => [ 'exclude' => true, + 'label' => 'Features', + 'config' => [ + 'type' => 'category', + 'minitems' => 0, + 'multiple' => true, + ], ], 'dates' => [ @@ -424,7 +381,6 @@ ], 'levelLinksPosition' => 'top', 'showPossibleLocalizationRecords' => false, - 'showRemovedLocalizationRecords' => false, 'showSynchronizationLink' => false, 'showAllLocalizationLink' => false, ], @@ -475,7 +431,6 @@ 'label' => $l10nPath . ':tx_events_domain_model_event.references_events', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'allowed' => 'tx_events_domain_model_event', 'suggestOptions' => [ 'tx_events_domain_model_event' => [ @@ -490,7 +445,6 @@ 'label' => $l10nPath . ':tx_events_domain_model_event.partner', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'allowed' => 'tx_events_domain_model_partner', 'fieldControl' => [ 'addRecord' => [ diff --git a/Configuration/TCA/tx_events_domain_model_import.php b/Configuration/TCA/tx_events_domain_model_import.php index 7a391e9d..cda62bbd 100644 --- a/Configuration/TCA/tx_events_domain_model_import.php +++ b/Configuration/TCA/tx_events_domain_model_import.php @@ -1,5 +1,7 @@ [ 'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import', @@ -8,7 +10,6 @@ 'label_alt_force' => true, 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'delete' => 'deleted', 'enablecolumns' => [ 'disabled' => 'hidden', @@ -48,8 +49,7 @@ 'renderType' => 'checkboxToggle', 'items' => [ [ - 0 => '', - 1 => '', + 'label' => '', 'invertStateDisplay' => true, ], ], @@ -72,7 +72,6 @@ 'description' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.storage_pid.description', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'allowed' => 'pages', 'size' => 1, 'maxitems' => 1, @@ -84,7 +83,6 @@ 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.region', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'allowed' => 'tx_events_domain_model_region', 'size' => 1, 'maxitems' => 1, @@ -97,7 +95,6 @@ 'description' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.categories_pid.description', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'allowed' => 'pages', 'size' => 1, 'maxitems' => 1, @@ -110,7 +107,6 @@ 'description' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.category_parent.description', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'allowed' => 'sys_category', 'size' => 1, 'maxitems' => 1, @@ -123,7 +119,6 @@ 'description' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.features_pid.description', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'allowed' => 'pages', 'size' => 1, 'maxitems' => 1, @@ -136,7 +131,6 @@ 'description' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.features_parent.description', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'allowed' => 'sys_category', 'size' => 1, 'maxitems' => 1, @@ -148,8 +142,7 @@ 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.files_folder', 'description' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.files_folder.description', 'config' => [ - 'type' => 'group', - 'internal_type' => 'folder', + 'type' => 'folder', 'size' => 1, 'maxitems' => 1, 'minitems' => 1, diff --git a/Configuration/TCA/tx_events_domain_model_location.php b/Configuration/TCA/tx_events_domain_model_location.php index f020bfbf..5c7d93b9 100644 --- a/Configuration/TCA/tx_events_domain_model_location.php +++ b/Configuration/TCA/tx_events_domain_model_location.php @@ -1,5 +1,7 @@ 'name', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'versioningWS' => true, 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', @@ -50,19 +51,7 @@ 'sys_language_uid' => [ 'exclude' => true, 'label' => $l10nPathGeneral . ':LGL.language', - 'config' => [ - 'type' => 'select', - 'renderType' => 'selectSingle', - 'special' => 'languages', - 'items' => [ - [ - $l10nPathGeneral . ':LGL.allLanguages', - -1, - 'flags-multiple', - ], - ], - 'default' => 0, - ], + 'config' => ['type' => 'language'], ], 'l10n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', @@ -72,7 +61,7 @@ 'renderType' => 'selectSingle', 'default' => 0, 'items' => [ - ['', 0], + ['label' => '', 'value' => 0], ], 'foreign_table' => 'tx_events_domain_model_location', 'foreign_table_where' => 'AND {#tx_events_domain_model_location}.{#pid}=###CURRENT_PID### AND {#tx_events_domain_model_location}.{#sys_language_uid} IN (-1,0)', @@ -99,8 +88,7 @@ 'renderType' => 'checkboxToggle', 'items' => [ [ - 0 => '', - 1 => '', + 'label' => '', 'invertStateDisplay' => true, ], ], @@ -110,10 +98,8 @@ 'exclude' => true, 'label' => $l10nPathGeneral . ':LGL.starttime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', - 'eval' => 'datetime,int', - 'default' => 0, + 'type' => 'datetime', + 'format' => 'datetime', 'behaviour' => [ 'allowLanguageSynchronization' => true, ], @@ -123,13 +109,8 @@ 'exclude' => true, 'label' => $l10nPathGeneral . ':LGL.endtime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', - 'eval' => 'datetime,int', - 'default' => 0, - 'range' => [ - 'upper' => mktime(0, 0, 0, 1, 1, 2038), - ], + 'type' => 'datetime', + 'format' => 'datetime', 'behaviour' => [ 'allowLanguageSynchronization' => true, ], diff --git a/Configuration/TCA/tx_events_domain_model_organizer.php b/Configuration/TCA/tx_events_domain_model_organizer.php index c776f7e6..b69f4977 100644 --- a/Configuration/TCA/tx_events_domain_model_organizer.php +++ b/Configuration/TCA/tx_events_domain_model_organizer.php @@ -1,12 +1,13 @@ [ 'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_organizer.xlf:tx_events_domain_model_organizer', 'label' => 'name', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'versioningWS' => true, 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', @@ -27,19 +28,7 @@ 'sys_language_uid' => [ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', - 'config' => [ - 'type' => 'select', - 'renderType' => 'selectSingle', - 'special' => 'languages', - 'items' => [ - [ - 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', - -1, - 'flags-multiple', - ], - ], - 'default' => 0, - ], + 'config' => ['type' => 'language'], ], 'l10n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', @@ -49,7 +38,7 @@ 'renderType' => 'selectSingle', 'default' => 0, 'items' => [ - ['', 0], + ['label' => '', 'value' => 0], ], 'foreign_table' => 'tx_events_domain_model_organizer', 'foreign_table_where' => 'AND {#tx_events_domain_model_organizer}.{#pid}=###CURRENT_PID### AND {#tx_events_domain_model_organizer}.{#sys_language_uid} IN (-1,0)', @@ -76,8 +65,7 @@ 'renderType' => 'checkboxToggle', 'items' => [ [ - 0 => '', - 1 => '', + 'label' => '', 'invertStateDisplay' => true, ], ], @@ -87,10 +75,8 @@ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', - 'eval' => 'datetime,int', - 'default' => 0, + 'type' => 'datetime', + 'format' => 'datetime', 'behaviour' => [ 'allowLanguageSynchronization' => true, ], @@ -100,13 +86,8 @@ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', - 'eval' => 'datetime,int', - 'default' => 0, - 'range' => [ - 'upper' => mktime(0, 0, 0, 1, 1, 2038), - ], + 'type' => 'datetime', + 'format' => 'datetime', 'behaviour' => [ 'allowLanguageSynchronization' => true, ], diff --git a/Configuration/TCA/tx_events_domain_model_partner.php b/Configuration/TCA/tx_events_domain_model_partner.php index 580a02d0..68a0ba70 100644 --- a/Configuration/TCA/tx_events_domain_model_partner.php +++ b/Configuration/TCA/tx_events_domain_model_partner.php @@ -1,12 +1,15 @@ [ 'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_partner.xlf:tx_events_domain_model_partner', 'label' => 'title', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'versioningWS' => true, 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', @@ -25,19 +28,7 @@ 'sys_language_uid' => [ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', - 'config' => [ - 'type' => 'select', - 'renderType' => 'selectSingle', - 'special' => 'languages', - 'items' => [ - [ - 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', - -1, - 'flags-multiple', - ], - ], - 'default' => 0, - ], + 'config' => ['type' => 'language'], ], 'l10n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', @@ -47,7 +38,7 @@ 'renderType' => 'selectSingle', 'default' => 0, 'items' => [ - ['', 0], + ['label' => '', 'value' => 0], ], 'foreign_table' => 'tx_events_domain_model_partner', 'foreign_table_where' => 'AND {#tx_events_domain_model_partner}.{#pid}=###CURRENT_PID### AND {#tx_events_domain_model_partner}.{#sys_language_uid} IN (-1,0)', @@ -74,8 +65,7 @@ 'renderType' => 'checkboxToggle', 'items' => [ [ - 0 => '', - 1 => '', + 'label' => '', 'invertStateDisplay' => true, ], ], @@ -95,21 +85,15 @@ 'exclude' => true, 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_partner.xlf:tx_events_domain_model_partner.link', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputLink', - 'eval' => 'trim', - 'max' => 1024, - 'size' => 50, - 'softref' => 'typolink', + 'type' => 'link', ], ], 'images' => [ 'exclude' => true, 'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_partner.xlf:tx_events_domain_model_partner.images', - 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('images', [ - 'appearance' => [ - 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference', - ], + 'config' => [ + 'type' => 'file', + 'allowed' => 'common-image-types', // custom configuration for displaying fields in the overlay/reference table // to use the imageoverlayPalette instead of the basicoverlayPalette 'overrideChildTca' => [ @@ -119,14 +103,14 @@ --palette--;;imageoverlayPalette, --palette--;;filePalette', ], - \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + File::FILETYPE_IMAGE => [ 'showitem' => ' --palette--;;imageoverlayPalette, --palette--;;filePalette', ], ], ], - ], $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']), + ], ], ], ]; diff --git a/Configuration/TCA/tx_events_domain_model_region.php b/Configuration/TCA/tx_events_domain_model_region.php index 3cc74c61..3b3f4290 100644 --- a/Configuration/TCA/tx_events_domain_model_region.php +++ b/Configuration/TCA/tx_events_domain_model_region.php @@ -1,12 +1,13 @@ [ 'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_region.xlf:tx_events_domain_model_region', 'label' => 'title', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'versioningWS' => true, 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', @@ -27,19 +28,7 @@ 'sys_language_uid' => [ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', - 'config' => [ - 'type' => 'select', - 'renderType' => 'selectSingle', - 'special' => 'languages', - 'items' => [ - [ - 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', - -1, - 'flags-multiple', - ], - ], - 'default' => 0, - ], + 'config' => ['type' => 'language'], ], 'l10n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', @@ -49,7 +38,7 @@ 'renderType' => 'selectSingle', 'default' => 0, 'items' => [ - ['', 0], + ['label' => '', 'value' => 0], ], 'foreign_table' => 'tx_events_domain_model_region', 'foreign_table_where' => 'AND {#tx_events_domain_model_region}.{#pid}=###CURRENT_PID### AND {#tx_events_domain_model_region}.{#sys_language_uid} IN (-1,0)', @@ -76,8 +65,7 @@ 'renderType' => 'checkboxToggle', 'items' => [ [ - 0 => '', - 1 => '', + 'label' => '', 'invertStateDisplay' => true, ], ], @@ -87,10 +75,8 @@ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', - 'eval' => 'datetime,int', - 'default' => 0, + 'type' => 'datetime', + 'format' => 'datetime', 'behaviour' => [ 'allowLanguageSynchronization' => true, ], @@ -100,13 +86,8 @@ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', - 'eval' => 'datetime,int', - 'default' => 0, - 'range' => [ - 'upper' => mktime(0, 0, 0, 1, 1, 2038), - ], + 'type' => 'datetime', + 'format' => 'datetime', 'behaviour' => [ 'allowLanguageSynchronization' => true, ], diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index 3b976911..718f6d0c 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -24,10 +24,6 @@ plugin.tx_events { recursive = 1 } - features { - skipDefaultArguments = 1 - } - mvc { callDefaultActionIfActionCantBeResolved = 1 } diff --git a/Documentation/Changelog/4.0.0.rst b/Documentation/Changelog/4.0.0.rst index 72581a20..3014e3ac 100644 --- a/Documentation/Changelog/4.0.0.rst +++ b/Documentation/Changelog/4.0.0.rst @@ -4,6 +4,11 @@ Breaking -------- +* Drop support of TYPO3 and PHP versions. + We drop support for any TYPO3 version below 12. + We drop support for PHP versions not supported by TYPO3 v12. + That eases the maintenance of the extension. + * Change of vendor/namespace. The vendor was renamed from `wrm` to `werkraummedia`. And the namespace vendor was renamed from `Wrm` to `WerkraumMedia`. @@ -11,10 +16,15 @@ Breaking That way all references to PHP classes as well as the package name itself need to be adjusted. +* No longer allow records on standard pages. + Please use TCA Overrides in case you need this none default TYPO3 behaviour. + Features -------- -Nothing +* Support TYPO3 v12. + +* Support PHP 8.1, 8.2, 8.3. Fixes ----- diff --git a/Documentation/Index.rst b/Documentation/Index.rst index d3409163..1b1626a2 100644 --- a/Documentation/Index.rst +++ b/Documentation/Index.rst @@ -42,7 +42,6 @@ Table of Contents Commands Settings Changelog - Maintenance .. toctree:: :hidden: diff --git a/Documentation/Maintenance.rst b/Documentation/Maintenance.rst deleted file mode 100644 index 0bc74878..00000000 --- a/Documentation/Maintenance.rst +++ /dev/null @@ -1,16 +0,0 @@ -.. _maintenance: - -Maintenance -=========== - -List of changes that need to be done for maintenance reasons. - -E.g. changes once we drop a certain TYPO3 version. -We might have new code backported for compatibility in older TYPO3 versions. -Those changes are documented so we know what to do once we drop an older version. - -.. toctree:: - :glob: - :reversed: - - Maintenance/TYPO3/* diff --git a/Documentation/Maintenance/TYPO3/V10.rst b/Documentation/Maintenance/TYPO3/V10.rst deleted file mode 100644 index 6d096a9f..00000000 --- a/Documentation/Maintenance/TYPO3/V10.rst +++ /dev/null @@ -1,17 +0,0 @@ -TYPO3 V10 -========= - -Changes that should happen once we drop TYPO3 v10. - - -Remove fetching cached page stage from body from tests ------------------------------------------------------- - -We have different assertions based on TYPO3 version, due to how TYPO3 exposes the info. -We can remove the condition with its content once we drop v10. - -Remove condition for page not found handling --------------------------------------------- - -The :php:`AbstractController->trigger404()` method has a condition to handle 404 differently for TYPO3 v10. -The condition can be removed. diff --git a/Documentation/Maintenance/TYPO3/V11.rst b/Documentation/Maintenance/TYPO3/V11.rst deleted file mode 100644 index cd2ca9d3..00000000 --- a/Documentation/Maintenance/TYPO3/V11.rst +++ /dev/null @@ -1,12 +0,0 @@ -TYPO3 V11 -========= - -Changes that should happen once we drop TYPO3 v11. - -Remove ``SlidingWindowPagination`` backport. --------------------------------------------- - -We backported https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Feature-94625-IntroduceSlidingWindowPagination.html. -That allowed us to use the new Code compatible with v12 onwards. - -We should remove the file ``Classes/Backports/V12/Pagination/SlidingWindowPagination.php`` and switch to TYPO3 native class within ``WerkraumMedia\Events\Pagination\Factory``. diff --git a/Patches/testing-framework-request-state.patch b/Patches/testing-framework-request-state.patch new file mode 100644 index 00000000..73768d04 --- /dev/null +++ b/Patches/testing-framework-request-state.patch @@ -0,0 +1,30 @@ +Issue: https://github.com/TYPO3/testing-framework/issues/517 +PR: https://github.com/TYPO3/testing-framework/pull/518 +diff --git a/Classes/Core/Functional/Framework/FrameworkState.php b/Classes/Core/Functional/Framework/FrameworkState.php +index 93716fc..f900539 100644 +--- a/Classes/Core/Functional/Framework/FrameworkState.php ++++ b/Classes/Core/Functional/Framework/FrameworkState.php +@@ -50,6 +50,7 @@ class FrameworkState + // different. And code that runs after that within the test scope may fail (eg. the referenceIndex check in tearDown() that + // relies on TCA). So we back up TCA for now before executing frontend tests. + $state['globals-tca'] = $GLOBALS['TCA']; ++ $state['request'] = $GLOBALS['TYPO3_REQUEST'] ?? null; + + // Can be dropped when GeneralUtility::getIndpEnv() is abandoned + $generalUtilityReflection = new \ReflectionClass(GeneralUtility::class); +@@ -67,6 +68,7 @@ class FrameworkState + public static function reset() + { + unset($GLOBALS['BE_USER']); ++ unset($GLOBALS['TYPO3_REQUEST']); + + $generalUtilityReflection = new \ReflectionClass(GeneralUtility::class); + $generalUtilityIndpEnvCache = $generalUtilityReflection->getProperty('indpEnvCache'); +@@ -91,6 +93,7 @@ class FrameworkState + } + + $GLOBALS['TCA'] = $state['globals-tca']; ++ $GLOBALS['TYPO3_REQUEST'] = $state['request']; + + $generalUtilityReflection = new \ReflectionClass(GeneralUtility::class); + $generalUtilityIndpEnvCache = $generalUtilityReflection->getProperty('indpEnvCache'); diff --git a/Patches/testing-framework-ts-record.patch b/Patches/testing-framework-ts-record.patch new file mode 100644 index 00000000..a94e3e7d --- /dev/null +++ b/Patches/testing-framework-ts-record.patch @@ -0,0 +1,18 @@ +Use "same" value for tstamp and crdate. +Otherwise TYPO3 will have different cache identifier if multiple requests with same instruction are given. +diff --git a/Resources/Core/Functional/Extensions/json_response/Classes/EventListener/AddTypoScriptFromInternalRequest.php b/Resources/Core/Functional/Extensions/json_response/Classes/EventListener/AddTypoScriptFromInternalRequest.php +index 111a997..504a899 100644 +--- a/Resources/Core/Functional/Extensions/json_response/Classes/EventListener/AddTypoScriptFromInternalRequest.php ++++ b/Resources/Core/Functional/Extensions/json_response/Classes/EventListener/AddTypoScriptFromInternalRequest.php +@@ -49,8 +49,8 @@ final class AddTypoScriptFromInternalRequest + $newTemplateRow = [ + 'uid' => PHP_INT_MAX, + 'pid' => PHP_INT_MAX, +- 'tstamp' => time(), +- 'crdate' => time(), ++ 'tstamp' => (new \DateTimeImmutable('midnight'))->format('U'), ++ 'crdate' => (new \DateTimeImmutable('midnight'))->format('U'), + 'deleted' => 0, + 'starttime' => 0, + 'endtime' => 0, + diff --git a/Tests/ClientFactory.php b/Tests/ClientFactory.php index a35998fe..d201430b 100644 --- a/Tests/ClientFactory.php +++ b/Tests/ClientFactory.php @@ -1,5 +1,7 @@ coreExtensionsToLoad = array_merge($this->coreExtensionsToLoad, [ + $this->coreExtensionsToLoad = [ + ...$this->coreExtensionsToLoad, 'filelist', 'fluid_styled_content', - ]); + ]; - $this->testExtensionsToLoad = array_merge($this->testExtensionsToLoad, [ + $this->testExtensionsToLoad = [ + ...$this->testExtensionsToLoad, 'typo3conf/ext/events', - ]); + ]; - $this->pathsToProvideInTestInstance = array_merge($this->pathsToProvideInTestInstance, [ + $this->pathsToLinkInTestInstance = [ + ...$this->pathsToLinkInTestInstance, 'typo3conf/ext/events/Tests/Functional/Frontend/Fixtures/Sites/' => 'typo3conf/sites', - ]); + ]; ArrayUtility::mergeRecursiveWithOverrule($this->configurationToUseInTestInstance, [ 'FE' => [ @@ -80,22 +83,16 @@ protected function setUp(): void 'processor_path_lzw' => '/usr/bin/', 'processor' => 'ImageMagick', ], - 'SC_OPTIONS' => [ - 'Core/TypoScript/TemplateService' => [ - 'runThroughTemplatesPostProcessing' => [ - 'FunctionalTest' => TypoScriptInstructionModifier::class . '->apply', - ], - ], - ], ]); parent::setUp(); - $this->setUpBackendUserFromFixture(1); + $this->importPHPDataSet(__DIR__ . '/Fixtures/BeUsers.php'); + $this->setUpBackendUser(1); $languageServiceFactory = $this->getContainer()->get(LanguageServiceFactory::class); if (!$languageServiceFactory instanceof LanguageServiceFactory) { - throw new \UnexpectedValueException('Did not retrieve LanguageServiceFactory.', 1637847250); + throw new UnexpectedValueException('Did not retrieve LanguageServiceFactory.', 1637847250); } $GLOBALS['LANG'] = $languageServiceFactory->create('default'); @@ -114,7 +111,7 @@ protected function tearDown(): void protected function getTypoScriptInstruction(): TypoScriptInstruction { - return new TypoScriptInstruction(TemplateService::class); + return new TypoScriptInstruction(); } protected function setUpConfiguration( @@ -152,7 +149,7 @@ protected function executeCommand( array $argumentsAndOptions = ['configurationUid' => '1'], string $command = ImportDestinationDataViaConfigruationCommand::class ): CommandTester { - $subject = $this->getContainer()->get($command); + $subject = $this->get($command); self::assertInstanceOf(Command::class, $subject); $tester = new CommandTester($subject); @@ -192,7 +189,7 @@ protected function setDateAspect(DateTimeImmutable $dateTime): void { $context = $this->getContainer()->get(Context::class); if (!$context instanceof Context) { - throw new \TypeError('Retrieved context was of unexpected type.', 1638182021); + throw new TypeError('Retrieved context was of unexpected type.', 1638182021); } $aspect = new DateTimeAspect($dateTime); diff --git a/Tests/Functional/Cleanup/Fixtures/RemoveAllTestDatabase.php b/Tests/Functional/Cleanup/Fixtures/RemoveAllTestDatabase.php index d5a6dbdf..12afa528 100644 --- a/Tests/Functional/Cleanup/Fixtures/RemoveAllTestDatabase.php +++ b/Tests/Functional/Cleanup/Fixtures/RemoveAllTestDatabase.php @@ -1,5 +1,7 @@ [ [ @@ -45,7 +47,6 @@ 'pid' => '0', 'tstamp' => '1423209858', 'crdate' => '1370878372', - 'cruser_id' => '0', 'deleted' => '0', 'name' => 'fileadmin/ (auto-created)', 'description' => 'This is the local fileadmin/ directory. This storage mount has been created automatically by TYPO3.', @@ -126,7 +127,6 @@ 'pid' => '0', 'tstamp' => '1371467047', 'crdate' => '1371467047', - 'cruser_id' => '1', 'file' => '1', ], [ @@ -134,7 +134,6 @@ 'pid' => '0', 'tstamp' => '1371467047', 'crdate' => '1371467047', - 'cruser_id' => '1', 'file' => '2', ], ], @@ -144,7 +143,6 @@ 'pid' => '2', 'tstamp' => '1373537480', 'crdate' => '1371484347', - 'cruser_id' => '1', 'deleted' => '0', 'hidden' => '0', 'sys_language_uid' => '0', @@ -153,14 +151,12 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => '1', - 'table_local' => 'sys_file', ], [ 'uid' => '2', 'pid' => '2', 'tstamp' => '1373537480', 'crdate' => '1371484347', - 'cruser_id' => '1', 'deleted' => '0', 'hidden' => '0', 'sys_language_uid' => '0', @@ -169,7 +165,6 @@ 'tablenames' => 'tx_events_domain_model_partner', 'fieldname' => 'images', 'sorting_foreign' => '1', - 'table_local' => 'sys_file', ], ], 'tx_events_domain_model_region' => [ diff --git a/Tests/Functional/Cleanup/Fixtures/RemovePastTestDatabase.php b/Tests/Functional/Cleanup/Fixtures/RemovePastTestDatabase.php index 13ce2483..b12ffb8e 100644 --- a/Tests/Functional/Cleanup/Fixtures/RemovePastTestDatabase.php +++ b/Tests/Functional/Cleanup/Fixtures/RemovePastTestDatabase.php @@ -1,5 +1,7 @@ [ [ @@ -51,7 +53,6 @@ 'pid' => '0', 'tstamp' => '1423209858', 'crdate' => '1370878372', - 'cruser_id' => '0', 'deleted' => '0', 'name' => 'fileadmin/ (auto-created)', 'description' => 'This is the local fileadmin/ directory. This storage mount has been created automatically by TYPO3.', @@ -212,7 +213,6 @@ 'pid' => '0', 'tstamp' => '1371467047', 'crdate' => '1371467047', - 'cruser_id' => '1', 'file' => '1', ], [ @@ -220,7 +220,6 @@ 'pid' => '0', 'tstamp' => '1371467047', 'crdate' => '1371467047', - 'cruser_id' => '1', 'file' => '2', ], [ @@ -228,7 +227,6 @@ 'pid' => '0', 'tstamp' => '1371467047', 'crdate' => '1371467047', - 'cruser_id' => '1', 'file' => '3', ], [ @@ -236,7 +234,6 @@ 'pid' => '0', 'tstamp' => '1371467047', 'crdate' => '1371467047', - 'cruser_id' => '1', 'file' => '4', ], [ @@ -244,7 +241,6 @@ 'pid' => '0', 'tstamp' => '1371467047', 'crdate' => '1371467047', - 'cruser_id' => '1', 'file' => '5', ], [ @@ -252,7 +248,6 @@ 'pid' => '0', 'tstamp' => '1371467047', 'crdate' => '1371467047', - 'cruser_id' => '1', 'file' => '6', ], ], @@ -262,7 +257,6 @@ 'pid' => '2', 'tstamp' => '1373537480', 'crdate' => '1371484347', - 'cruser_id' => '1', 'deleted' => '0', 'hidden' => '0', 'sys_language_uid' => '0', @@ -271,14 +265,12 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => '1', - 'table_local' => 'sys_file', ], [ 'uid' => '2', 'pid' => '2', 'tstamp' => '1373537480', 'crdate' => '1371484347', - 'cruser_id' => '1', 'deleted' => '0', 'hidden' => '0', 'sys_language_uid' => '0', @@ -287,14 +279,12 @@ 'tablenames' => 'tx_events_domain_model_partner', 'fieldname' => 'images', 'sorting_foreign' => '1', - 'table_local' => 'sys_file', ], [ 'uid' => '3', 'pid' => '2', 'tstamp' => '1373537480', 'crdate' => '1371484347', - 'cruser_id' => '1', 'deleted' => '0', 'hidden' => '0', 'sys_language_uid' => '0', @@ -303,14 +293,12 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => '1', - 'table_local' => 'sys_file', ], [ 'uid' => '4', 'pid' => '2', 'tstamp' => '1373537480', 'crdate' => '1371484347', - 'cruser_id' => '1', 'deleted' => '1', 'hidden' => '0', 'sys_language_uid' => '0', @@ -319,14 +307,12 @@ 'tablenames' => 'tt_content', 'fieldname' => 'images', 'sorting_foreign' => '1', - 'table_local' => 'sys_file', ], [ 'uid' => '5', 'pid' => '2', 'tstamp' => '1373537480', 'crdate' => '1371484347', - 'cruser_id' => '1', 'deleted' => '0', 'hidden' => '0', 'sys_language_uid' => '0', @@ -335,14 +321,12 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => '1', - 'table_local' => 'sys_file', ], [ 'uid' => '6', 'pid' => '2', 'tstamp' => '1373537480', 'crdate' => '1371484347', - 'cruser_id' => '1', 'deleted' => '0', 'hidden' => '0', 'sys_language_uid' => '0', @@ -351,14 +335,12 @@ 'tablenames' => '', 'fieldname' => '', 'sorting_foreign' => '0', - 'table_local' => 'sys_file', ], [ 'uid' => '7', 'pid' => '0', 'tstamp' => '1373537480', 'crdate' => '1371484347', - 'cruser_id' => '1', 'deleted' => '0', 'hidden' => '0', 'sys_language_uid' => '0', @@ -367,14 +349,12 @@ 'tablenames' => 'pages', 'fieldname' => 'media', 'sorting_foreign' => '0', - 'table_local' => 'sys_file', ], [ 'uid' => '8', 'pid' => '0', 'tstamp' => '1373537480', 'crdate' => '1371484347', - 'cruser_id' => '1', 'deleted' => '0', 'hidden' => '0', 'sys_language_uid' => '0', @@ -383,7 +363,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => '2', - 'table_local' => 'sys_file', ], ], 'tx_events_domain_model_region' => [ diff --git a/Tests/Functional/Cleanup/RemoveAllTest.php b/Tests/Functional/Cleanup/RemoveAllTest.php index a01650a6..140fcb1f 100644 --- a/Tests/Functional/Cleanup/RemoveAllTest.php +++ b/Tests/Functional/Cleanup/RemoveAllTest.php @@ -1,16 +1,18 @@ importPHPDataSet(__DIR__ . '/Fixtures/RemoveAllTestDatabase.php'); diff --git a/Tests/Functional/Cleanup/RemovePastTest.php b/Tests/Functional/Cleanup/RemovePastTest.php index e6f86134..4524dc53 100644 --- a/Tests/Functional/Cleanup/RemovePastTest.php +++ b/Tests/Functional/Cleanup/RemovePastTest.php @@ -1,16 +1,18 @@ importPHPDataSet(__DIR__ . '/Fixtures/RemovePastTestDatabase.php'); diff --git a/Tests/Functional/Fixtures/BeUsers.php b/Tests/Functional/Fixtures/BeUsers.php new file mode 100644 index 00000000..ddeafd50 --- /dev/null +++ b/Tests/Functional/Fixtures/BeUsers.php @@ -0,0 +1,19 @@ + [ + [ + 'uid' => 1, + 'pid' => 0, + 'tstamp' => 1366642540, + 'username' => 'admin', + 'password' => '$1$tCrlLajZ$C0sikFQQ3SWaFAZ1Me0Z/1', // password + 'admin' => 1, + 'disable' => 0, + 'crdate' => 1366642540, + 'deleted' => 0, + ], + ], +]; diff --git a/Tests/Functional/Frontend/CacheTest.php b/Tests/Functional/Frontend/CacheTest.php index 61e1804d..f70e0b1e 100644 --- a/Tests/Functional/Frontend/CacheTest.php +++ b/Tests/Functional/Frontend/CacheTest.php @@ -27,14 +27,14 @@ use DateTimeImmutable; use DateTimeZone; use GuzzleHttp\Psr7\Response; +use PHPUnit\Framework\Attributes\Test; use Psr\Http\Message\ResponseInterface; +use TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend; +use TYPO3\CMS\Core\Cache\CacheManager; use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; use WerkraumMedia\Events\Tests\Functional\AbstractFunctionalTestCase; -/** - * @covers \WerkraumMedia\Events\Caching\PageCacheTimeout - */ class CacheTest extends AbstractFunctionalTestCase { protected function setUp(): void @@ -42,9 +42,28 @@ protected function setUp(): void $this->testExtensionsToLoad = [ 'typo3conf/ext/events/Tests/Functional/Frontend/Fixtures/Extensions/example', ]; + $this->configurationToUseInTestInstance = [ + 'SYS' => [ + // Combined with flushCaches. + // Ensures that we have expected TYPO3 caching within each test. + // But we don't keep caches from one test to the other. + 'caching' => [ + 'cacheConfigurations' => [ + 'pages' => [ + 'backend' => SimpleFileBackend::class, + 'options' => [ + 'compression' => '__UNSET', + ], + ], + ], + ], + ], + ]; parent::setUp(); + $this->get(CacheManager::class)->flushCaches(); + $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SiteStructure.php'); (new PhpDataSet())->import(['tt_content' => [[ 'uid' => '1', @@ -56,21 +75,17 @@ protected function setUp(): void $this->setUpFrontendRendering(); } - /** - * @test - */ + #[Test] public function returnsSystemDefaults(): void { - $response = $this->executeFrontendRequest($this->getRequestWithSleep()); + $response = $this->executeFrontendSubRequest($this->getRequestWithSleep()); self::assertSame(200, $response->getStatusCode()); self::assertSame('max-age=86400', $response->getHeaderLine('Cache-Control')); self::assertSame('public', $response->getHeaderLine('Pragma')); } - /** - * @test - */ + #[Test] public function returnsDefaultsIfEventsEndLater(): void { (new PhpDataSet())->import([ @@ -89,16 +104,14 @@ public function returnsDefaultsIfEventsEndLater(): void ], ]); - $response = $this->executeFrontendRequest($this->getRequestWithSleep()); + $response = $this->executeFrontendSubRequest($this->getRequestWithSleep()); self::assertSame(200, $response->getStatusCode()); self::assertSame('max-age=86400', $response->getHeaderLine('Cache-Control')); self::assertSame('public', $response->getHeaderLine('Pragma')); } - /** - * @test - */ + #[Test] public function returnsEarlierIfEventsEndEarlier(): void { $end = (new DateTimeImmutable('tomorrow midnight', new DateTimeZone('UTC')))->modify('+2 hours'); @@ -121,15 +134,13 @@ public function returnsEarlierIfEventsEndEarlier(): void ], ]); - $response = $this->executeFrontendRequest($this->getRequestWithSleep()); + $response = $this->executeFrontendSubRequest($this->getRequestWithSleep()); self::assertSame(200, $response->getStatusCode()); self::assertCacheHeaders($end, $response); } - /** - * @test - */ + #[Test] public function returnsEarlierIfStartEndEalierAndIsUpcoming(): void { $end = (new DateTimeImmutable('now', new DateTimeZone('UTC')))->modify('+2 hours'); @@ -152,7 +163,7 @@ public function returnsEarlierIfStartEndEalierAndIsUpcoming(): void ], ]); - $response = $this->executeFrontendRequest($this->getRequestWithSleep([ + $response = $this->executeFrontendSubRequest($this->getRequestWithSleep([ 'plugin.' => [ 'tx_events.' => [ 'settings.' => [ @@ -166,9 +177,7 @@ public function returnsEarlierIfStartEndEalierAndIsUpcoming(): void self::assertCacheHeaders($end, $response); } - /** - * @test - */ + #[Test] public function usesEarliestTimeout(): void { $end = (new DateTimeImmutable('now', new DateTimeZone('UTC')))->modify('+2 hours'); @@ -202,7 +211,7 @@ public function usesEarliestTimeout(): void ], ]); - $response = $this->executeFrontendRequest($this->getRequestWithSleep([ + $response = $this->executeFrontendSubRequest($this->getRequestWithSleep([ 'plugin.' => [ 'tx_events.' => [ 'settings.' => [ @@ -216,9 +225,7 @@ public function usesEarliestTimeout(): void self::assertCacheHeaders($end, $response); } - /** - * @test - */ + #[Test] public function returnsMidnightIfConfigured(): void { $midnight = (new DateTimeImmutable('tomorrow midnight', new DateTimeZone('UTC'))); @@ -247,21 +254,19 @@ public function returnsMidnightIfConfigured(): void ], ])); - $response = $this->executeFrontendRequest($this->getRequestWithSleep()); + $response = $this->executeFrontendSubRequest($this->getRequestWithSleep()); self::assertSame(200, $response->getStatusCode()); self::assertCacheHeaders($midnight, $response); self::assertSame('public', $response->getHeaderLine('Pragma')); } - /** - * @test - */ + #[Test] public function cachesAreClearedByImport(): void { // Assert frontend is cached - $this->assertResponseIsNotCached($this->executeFrontendRequest($this->getRequestWithSleep())); - $this->assertResponseIsCached($this->executeFrontendRequest($this->getRequestWithSleep())); + $this->assertResponseIsNotCached($this->executeFrontendSubRequest($this->getRequestWithSleep())); + $this->assertResponseIsCached($this->executeFrontendSubRequest($this->getRequestWithSleep())); // Import $this->importPHPDataSet(__DIR__ . '/../Import/DestinationDataTest/Fixtures/Database/DefaultImportConfiguration.php'); @@ -281,8 +286,8 @@ public function cachesAreClearedByImport(): void // Assert frontend is not cached on first hit $this->setUpFrontendRendering(); - $this->assertResponseIsNotCached($this->executeFrontendRequest($this->getRequestWithSleep())); - $this->assertResponseIsCached($this->executeFrontendRequest($this->getRequestWithSleep())); + $this->assertResponseIsNotCached($this->executeFrontendSubRequest($this->getRequestWithSleep())); + $this->assertResponseIsCached($this->executeFrontendSubRequest($this->getRequestWithSleep())); } private static function assertCacheHeaders(DateTimeImmutable $end, ResponseInterface $response): void @@ -316,10 +321,6 @@ private function assertResponseIsNotCached(ResponseInterface $response): void private function assertResponseIsCached(ResponseInterface $response): void { - if ((new Typo3Version())->getMajorVersion() < 11) { - self::assertStringContainsString('Cached page', $response->getBody()->__toString()); - return; - } self::assertStringStartsWith('Cached page', $response->getHeaderLine('X-TYPO3-Debug-Cache')); } diff --git a/Tests/Functional/Frontend/DatesTest.php b/Tests/Functional/Frontend/DatesTest.php index 7f301d20..67b99dfe 100644 --- a/Tests/Functional/Frontend/DatesTest.php +++ b/Tests/Functional/Frontend/DatesTest.php @@ -23,13 +23,11 @@ namespace WerkraumMedia\Events\Tests\Functional\Frontend; +use PHPUnit\Framework\Attributes\Test; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; use WerkraumMedia\Events\Frontend\Dates; use WerkraumMedia\Events\Tests\Functional\AbstractFunctionalTestCase; -/** - * @covers \WerkraumMedia\Events\Frontend\Dates - */ class DatesTest extends AbstractFunctionalTestCase { protected function setUp(): void @@ -46,16 +44,15 @@ protected function setUp(): void * Dates don't make any sense without an event, as they not even have a name. * * They therefore should not be fetched from persistence. - * - * @test */ + #[Test] public function returnsOnlyDatesWithAvailableEventByDemand(): void { - $this->importCSVDataSet(__DIR__ . '/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.csv'); + $this->importPHPDataSet(__DIR__ . '/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.php'); $request = new InternalRequest(); $request = $request->withPageId(1); - $response = $this->executeFrontendRequest($request); + $response = $this->executeFrontendSubRequest($request); self::assertSame(200, $response->getStatusCode()); $html = (string)$response->getBody(); @@ -64,19 +61,17 @@ public function returnsOnlyDatesWithAvailableEventByDemand(): void self::assertStringContainsString('Event 2 visible', $html); } - /** - * @test - */ + #[Test] public function returnsDateAfterStart(): void { - $this->importCSVDataSet(__DIR__ . '/DatesTestFixtures/ReturnsDateWithinTimeSpan.csv'); + $this->importPHPDataSet(__DIR__ . '/DatesTestFixtures/ReturnsDateWithinTimeSpan.php'); $request = new InternalRequest(); $request = $request->withPageId(1); $request = $request->withQueryParameters([ 'events_search[search][start]' => '2023-02-16', ]); - $response = $this->executeFrontendRequest($request); + $response = $this->executeFrontendSubRequest($request); self::assertSame(200, $response->getStatusCode()); $html = (string)$response->getBody(); @@ -92,19 +87,17 @@ public function returnsDateAfterStart(): void self::assertStringContainsString('Event 9', $html); } - /** - * @test - */ + #[Test] public function returnsDateBeforeEnd(): void { - $this->importCSVDataSet(__DIR__ . '/DatesTestFixtures/ReturnsDateWithinTimeSpan.csv'); + $this->importPHPDataSet(__DIR__ . '/DatesTestFixtures/ReturnsDateWithinTimeSpan.php'); $request = new InternalRequest(); $request = $request->withPageId(1); $request = $request->withQueryParameters([ 'events_search[search][end]' => '2023-02-17', ]); - $response = $this->executeFrontendRequest($request); + $response = $this->executeFrontendSubRequest($request); self::assertSame(200, $response->getStatusCode()); $html = (string)$response->getBody(); @@ -124,12 +117,11 @@ public function returnsDateBeforeEnd(): void * Covers issue https://redmine.werkraum-media.de/issues/10350. * A date can span multiple dates. * The visitor might search a time frame within the spaned dates and expects the date to be shown. - * - * @test */ + #[Test] public function returnsDateWithinTimeSpan(): void { - $this->importCSVDataSet(__DIR__ . '/DatesTestFixtures/ReturnsDateWithinTimeSpan.csv'); + $this->importPHPDataSet(__DIR__ . '/DatesTestFixtures/ReturnsDateWithinTimeSpan.php'); $request = new InternalRequest(); $request = $request->withPageId(1); @@ -137,7 +129,7 @@ public function returnsDateWithinTimeSpan(): void 'events_search[search][start]' => '2023-02-16', 'events_search[search][end]' => '2023-02-17', ]); - $response = $this->executeFrontendRequest($request); + $response = $this->executeFrontendSubRequest($request); self::assertSame(200, $response->getStatusCode()); $html = (string)$response->getBody(); @@ -153,26 +145,22 @@ public function returnsDateWithinTimeSpan(): void self::assertStringContainsString('Event 9', $html); } - /** - * @test - */ + #[Test] public function returns404IfEventIsHidden(): void { - $this->importCSVDataSet(__DIR__ . '/DatesTestFixtures/Returns404IfEventIsHidden.csv'); + $this->importPHPDataSet(__DIR__ . '/DatesTestFixtures/Returns404IfEventIsHidden.php'); $request = new InternalRequest(); $request = $request->withPageId(1); $request = $request->withQueryParameters([ 'tx_events_dateshow[date]' => '1', ]); - $response = $this->executeFrontendRequest($request); + $response = $this->executeFrontendSubRequest($request); self::assertSame(404, $response->getStatusCode()); } - /** - * @test - */ + #[Test] public function returnsUpcomingDates(): void { $this->importPHPDataSet(__DIR__ . '/DatesTestFixtures/ReturnsUpcomingDates.php'); @@ -191,7 +179,7 @@ public function returnsUpcomingDates(): void ], ]), ]); - $response = $this->executeFrontendRequest($request); + $response = $this->executeFrontendSubRequest($request); self::assertSame(200, $response->getStatusCode()); $html = (string)$response->getBody(); diff --git a/Tests/Functional/Frontend/DatesTestFixtures/Returns404IfEventIsHidden.csv b/Tests/Functional/Frontend/DatesTestFixtures/Returns404IfEventIsHidden.csv deleted file mode 100644 index a4e309ed..00000000 --- a/Tests/Functional/Frontend/DatesTestFixtures/Returns404IfEventIsHidden.csv +++ /dev/null @@ -1,9 +0,0 @@ -tt_content -,uid,pid,CType,list_type,header -,1,1,list,events_dateshow,Singleview -tx_events_domain_model_event -,uid,pid,title,hidden -,1,2,"Event 1 starts before search, ends before search",1 -tx_events_domain_model_date -,uid,pid,event,start,end -,1,2,1,1676419200,1676484000 diff --git a/Tests/Functional/Frontend/DatesTestFixtures/Returns404IfEventIsHidden.php b/Tests/Functional/Frontend/DatesTestFixtures/Returns404IfEventIsHidden.php new file mode 100644 index 00000000..76806afa --- /dev/null +++ b/Tests/Functional/Frontend/DatesTestFixtures/Returns404IfEventIsHidden.php @@ -0,0 +1,32 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '1', + 'CType' => 'list', + 'list_type' => 'events_dateshow', + 'header' => 'Singleview', + ], + ], + 'tx_events_domain_model_event' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'title' => 'Event 1 starts before search, ends before search', + 'hidden' => '1', + ], + ], + 'tx_events_domain_model_date' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'event' => '1', + 'start' => '1676419200', + 'end' => '1676484000', + ], + ], +]; diff --git a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsDateWithinTimeSpan.csv b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsDateWithinTimeSpan.csv deleted file mode 100644 index 0aeabce1..00000000 --- a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsDateWithinTimeSpan.csv +++ /dev/null @@ -1,25 +0,0 @@ -tt_content -,uid,pid,CType,list_type,header -,1,1,list,events_datelist,All Dates -tx_events_domain_model_event -,uid,pid,title -,1,2,Event 1 starts before search, ends before search -,2,2,Event 2 starts before search, no end -,3,2,Event 3 starts after search, ends after search -,4,2,Event 4 starts after search, no end -,5,2,Event 5 starts before search, ends after search -,6,2,Event 6 starts inside search, ends inside search -,7,2,Event 7 starts inside search, ends after search -,8,2,Event 8 starts inside search, no end -,9,2,Event 9 starts before search, ends inside search -tx_events_domain_model_date -,uid,pid,event,start,end -,1,2,1,1676419200,1676484000 -,2,2,2,1676419200,"\NULL" -,3,2,3,1676678400,1676743200 -,4,2,4,1676678400,"\NULL" -,5,2,5,1676419200,1676678400 -,6,2,6,1676559600,1676570400 -,7,2,7,1676559600,1676678400 -,8,2,8,1676559600,"\NULL" -,9,2,9,1676419200,1676570400 diff --git a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsDateWithinTimeSpan.php b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsDateWithinTimeSpan.php new file mode 100644 index 00000000..f45d5936 --- /dev/null +++ b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsDateWithinTimeSpan.php @@ -0,0 +1,127 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '1', + 'CType' => 'list', + 'list_type' => 'events_datelist', + 'header' => 'All Dates', + ], + ], + 'tx_events_domain_model_event' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'title' => 'Event 1 starts before search, ends before search', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'title' => 'Event 2 starts before search, no end', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'title' => 'Event 3 starts after search, ends after search', + ], + 3 => [ + 'uid' => '4', + 'pid' => '2', + 'title' => 'Event 4 starts after search, no end', + ], + 4 => [ + 'uid' => '5', + 'pid' => '2', + 'title' => 'Event 5 starts before search, ends after search', + ], + 5 => [ + 'uid' => '6', + 'pid' => '2', + 'title' => 'Event 6 starts inside search, ends inside search', + ], + 6 => [ + 'uid' => '7', + 'pid' => '2', + 'title' => 'Event 7 starts inside search, ends after search', + ], + 7 => [ + 'uid' => '8', + 'pid' => '2', + 'title' => 'Event 8 starts inside search, no end', + ], + 8 => [ + 'uid' => '9', + 'pid' => '2', + 'title' => 'Event 9 starts before search, ends inside search', + ], + ], + 'tx_events_domain_model_date' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'event' => '1', + 'start' => '1676419200', + 'end' => '1676484000', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'event' => '2', + 'start' => '1676419200', + 'end' => '\\NULL', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'event' => '3', + 'start' => '1676678400', + 'end' => '1676743200', + ], + 3 => [ + 'uid' => '4', + 'pid' => '2', + 'event' => '4', + 'start' => '1676678400', + 'end' => '\\NULL', + ], + 4 => [ + 'uid' => '5', + 'pid' => '2', + 'event' => '5', + 'start' => '1676419200', + 'end' => '1676678400', + ], + 5 => [ + 'uid' => '6', + 'pid' => '2', + 'event' => '6', + 'start' => '1676559600', + 'end' => '1676570400', + ], + 6 => [ + 'uid' => '7', + 'pid' => '2', + 'event' => '7', + 'start' => '1676559600', + 'end' => '1676678400', + ], + 7 => [ + 'uid' => '8', + 'pid' => '2', + 'event' => '8', + 'start' => '1676559600', + 'end' => '\\NULL', + ], + 8 => [ + 'uid' => '9', + 'pid' => '2', + 'event' => '9', + 'start' => '1676419200', + 'end' => '1676570400', + ], + ], +]; diff --git a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.csv b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.csv deleted file mode 100644 index c6d98b9c..00000000 --- a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.csv +++ /dev/null @@ -1,11 +0,0 @@ -tt_content -,uid,pid,CType,list_type,header -,1,1,list,events_datelist,All Dates -tx_events_domain_model_event -,uid,pid,title,hidden -,1,2,Event 1 hidden,1 -,2,2,Event 2 visible,0 -tx_events_domain_model_date -,uid,pid,event,start,end -,1,2,1,1662458400,1662469200 -,2,2,2,1662458400,1662469200 diff --git a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.php b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.php new file mode 100644 index 00000000..b3d290a9 --- /dev/null +++ b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.php @@ -0,0 +1,45 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '1', + 'CType' => 'list', + 'list_type' => 'events_datelist', + 'header' => 'All Dates', + ], + ], + 'tx_events_domain_model_event' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'title' => 'Event 1 hidden', + 'hidden' => '1', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'title' => 'Event 2 visible', + 'hidden' => '0', + ], + ], + 'tx_events_domain_model_date' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'event' => '1', + 'start' => '1662458400', + 'end' => '1662469200', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'event' => '2', + 'start' => '1662458400', + 'end' => '1662469200', + ], + ], +]; diff --git a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsUpcomingDates.php b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsUpcomingDates.php index 2cd7aeb7..44309cbe 100644 --- a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsUpcomingDates.php +++ b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsUpcomingDates.php @@ -1,6 +1,6 @@ [ diff --git a/Tests/Functional/Frontend/FilterTest.php b/Tests/Functional/Frontend/FilterTest.php index edc8291e..18649e7a 100644 --- a/Tests/Functional/Frontend/FilterTest.php +++ b/Tests/Functional/Frontend/FilterTest.php @@ -4,13 +4,10 @@ namespace WerkraumMedia\Events\Tests\Functional\Frontend; +use PHPUnit\Framework\Attributes\Test; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; use WerkraumMedia\Events\Tests\Functional\AbstractFunctionalTestCase; -/** - * @covers \WerkraumMedia\Events\Controller\DateController - * @covers \WerkraumMedia\Events\Domain\Repository\DateRepository - */ class FilterTest extends AbstractFunctionalTestCase { protected function setUp(): void @@ -21,16 +18,14 @@ protected function setUp(): void $this->setUpFrontendRendering(); } - /** - * @test - */ + #[Test] public function canFilterByASingleLocationViaFlexform(): void { $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/FilterByASingleLocationViaFlexform.php'); $request = new InternalRequest(); $request = $request->withPageId(1); - $response = $this->executeFrontendRequest($request); + $response = $this->executeFrontendSubRequest($request); self::assertSame(200, $response->getStatusCode()); $html = (string)$response->getBody(); @@ -39,16 +34,14 @@ public function canFilterByASingleLocationViaFlexform(): void self::assertStringContainsString('Was hat das Universum mit mir zu tun?', $html); } - /** - * @test - */ + #[Test] public function canFilterByTwoLocationsViaFlexform(): void { $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/FilterByTwoLocationsViaFlexform.php'); $request = new InternalRequest(); $request = $request->withPageId(1); - $response = $this->executeFrontendRequest($request); + $response = $this->executeFrontendSubRequest($request); self::assertSame(200, $response->getStatusCode()); $html = (string)$response->getBody(); diff --git a/Tests/Functional/Frontend/Fixtures/Database/FilterByASingleLocationViaFlexform.php b/Tests/Functional/Frontend/Fixtures/Database/FilterByASingleLocationViaFlexform.php index 37a248d9..8b2b4150 100644 --- a/Tests/Functional/Frontend/Fixtures/Database/FilterByASingleLocationViaFlexform.php +++ b/Tests/Functional/Frontend/Fixtures/Database/FilterByASingleLocationViaFlexform.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Frontend/Fixtures/Database/FilterByTwoLocationsViaFlexform.php b/Tests/Functional/Frontend/Fixtures/Database/FilterByTwoLocationsViaFlexform.php index a8e61c7e..3c9f90cd 100644 --- a/Tests/Functional/Frontend/Fixtures/Database/FilterByTwoLocationsViaFlexform.php +++ b/Tests/Functional/Frontend/Fixtures/Database/FilterByTwoLocationsViaFlexform.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Frontend/Fixtures/Database/SiteStructure.php b/Tests/Functional/Frontend/Fixtures/Database/SiteStructure.php index 5ba516bc..63bab241 100644 --- a/Tests/Functional/Frontend/Fixtures/Database/SiteStructure.php +++ b/Tests/Functional/Frontend/Fixtures/Database/SiteStructure.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Frontend/Fixtures/Extensions/example/Classes/UserFunc.php b/Tests/Functional/Frontend/Fixtures/Extensions/example/Classes/UserFunc.php index 32290591..2f0c82eb 100644 --- a/Tests/Functional/Frontend/Fixtures/Extensions/example/Classes/UserFunc.php +++ b/Tests/Functional/Frontend/Fixtures/Extensions/example/Classes/UserFunc.php @@ -26,12 +26,14 @@ use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; -class UserFunc +final class UserFunc { - /** - * @var ContentObjectRenderer - */ - public $cObj; + private ContentObjectRenderer $cObj; + + public function setContentObjectRenderer(ContentObjectRenderer $cObj): void + { + $this->cObj = $cObj; + } public function accessTsfeTimeout(): string { diff --git a/Tests/Functional/Frontend/Fixtures/Extensions/example/ext_emconf.php b/Tests/Functional/Frontend/Fixtures/Extensions/example/ext_emconf.php index 58693cab..6abba815 100644 --- a/Tests/Functional/Frontend/Fixtures/Extensions/example/ext_emconf.php +++ b/Tests/Functional/Frontend/Fixtures/Extensions/example/ext_emconf.php @@ -1,5 +1,7 @@ 'Events Test', 'category' => 'plugin', diff --git a/Tests/Functional/Frontend/Fixtures/Extensions/example/ext_localconf.php b/Tests/Functional/Frontend/Fixtures/Extensions/example/ext_localconf.php index c9439eb3..2a0c0dfa 100644 --- a/Tests/Functional/Frontend/Fixtures/Extensions/example/ext_localconf.php +++ b/Tests/Functional/Frontend/Fixtures/Extensions/example/ext_localconf.php @@ -1,7 +1,12 @@ 'list'] + [DateController::class => 'list'] ); diff --git a/Tests/Functional/Import/DestinationDataTest/AbstractTest.php b/Tests/Functional/Import/DestinationDataTest/AbstractTestCase.php similarity index 87% rename from Tests/Functional/Import/DestinationDataTest/AbstractTest.php rename to Tests/Functional/Import/DestinationDataTest/AbstractTestCase.php index 4da8d084..149f4217 100644 --- a/Tests/Functional/Import/DestinationDataTest/AbstractTest.php +++ b/Tests/Functional/Import/DestinationDataTest/AbstractTestCase.php @@ -1,10 +1,12 @@ [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Schillerhaus Rudolstadt', + 'street' => 'Schillerstraße 25', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '+ 49 3672 / 486470', + 'web' => 'http://schillerhaus.rudolstadt.de', + 'email' => 'schillerhaus@rudolstadt.de', + ], + ], + 'tx_events_domain_model_event' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Allerlei Weihnachtliches (Heute mit Johannes Geißer)', + 'subtitle' => '', + 'global_id' => 'e_100347853', + 'highlight' => '0', + 'teaser' => '', + 'dates' => '1', + ], + ], + 'tx_events_domain_model_date' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '1', + 'start' => '4101372000', + 'end' => '4101377400', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + ], + 'sys_category' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '0', + 'l10n_parent' => '0', + 'title' => 'Top Category', + 'items' => '0', + 'parent' => '0', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '0', + 'l10n_parent' => '0', + 'title' => 'Event Category Parent', + 'items' => '0', + 'parent' => '1', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '0', + 'l10n_parent' => '0', + 'title' => 'Weihnachten', + 'items' => '0', + 'parent' => '2', + ], + ], + 'sys_category_record_mm' => [ + 0 => [ + 'uid_local' => '3', + 'uid_foreign' => '1', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'categories', + ], + ], + 'sys_file_metadata' => [ + 0 => [ + 'uid' => '1', + 'pid' => '0', + 'title' => 'This title is longer then the supported 255 chars as limited by default by TYPO3 database. Also c …', + 'description' => 'This is a supported description', + 'alternative' => 'This is a supported description', + ], + ], + 'sys_file_reference' => [ + 0 => [ + 'uid' => '1', + 'uid_local' => '1', + 'uid_foreign' => '1', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'images', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportDoesntEndUpInEndlessDateCreation.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportDoesntEndUpInEndlessDateCreation.php new file mode 100644 index 00000000..af37e645 --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportDoesntEndUpInEndlessDateCreation.php @@ -0,0 +1,90 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Schillerhaus Rudolstadt', + 'street' => 'Schillerstraße 25', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '+ 49 3672 / 486470', + 'web' => 'http://schillerhaus.rudolstadt.de', + 'email' => 'schillerhaus@rudolstadt.de', + ], + ], + 'tx_events_domain_model_event' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Allerlei Weihnachtliches (Heute mit Johannes Geißer)', + 'subtitle' => '', + 'global_id' => 'e_100347853', + 'highlight' => '0', + 'teaser' => '', + 'dates' => '2', + ], + ], + 'tx_events_domain_model_date' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '1', + 'start' => '1656748800', + 'end' => '1656770400', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '1', + 'start' => '1657353600', + 'end' => '1657375200', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportDoesntEndUpInEndlessDateCreationTest.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportDoesntEndUpInEndlessDateCreationTest.csv deleted file mode 100644 index c3912c1d..00000000 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportDoesntEndUpInEndlessDateCreationTest.csv +++ /dev/null @@ -1,10 +0,0 @@ -"tx_events_domain_model_organizer",,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","deleted","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","t3ver_stage","name","street","district","city","zip","phone","web","email" -,"1","2","0","0","0","0","0","-1","0","0","0","0","0","Schillerhaus Rudolstadt","Schillerstraße 25",,"Rudolstadt","07407","+ 49 3672 / 486470","http://schillerhaus.rudolstadt.de","schillerhaus@rudolstadt.de" -"tx_events_domain_model_event",,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","deleted","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","t3ver_stage","title","subtitle","global_id","highlight","teaser","dates",, -,"1","2","0","0","0","0","0","-1","0","0","0","0","0","Allerlei Weihnachtliches (Heute mit Johannes Geißer)",,"e_100347853","0",,"2",, -"tx_events_domain_model_date",,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","event","start","end","canceled","postponed_date","canceled_link",,,, -,"1","2","0","0","0","0",-1,0,"0","0","0","1",1656748800,1656770400,"no","0",,,,, -,"2","2","0","0","0","0",-1,0,"0","0","0","1",1657353600,1657375200,"no","0",,,,, diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsMultipleImagestoSingleEvent.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsMultipleImagestoSingleEvent.php index ac102f4a..dcd05028 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsMultipleImagestoSingleEvent.php +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsMultipleImagestoSingleEvent.php @@ -1,5 +1,9 @@ [ [ @@ -7,7 +11,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', 'extension' => 'jpg', 'name' => 'theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', @@ -17,7 +21,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/tueftlerzeit-sfz-rudolstadt-jpg.jpg', 'extension' => 'jpg', 'name' => 'tueftlerzeit-sfz-rudolstadt-jpg.jpg', @@ -32,7 +36,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 1, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, @@ -45,7 +48,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 2, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsNewImageToExistingImages.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsNewImageToExistingImages.php index dae5ed00..5665f5aa 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsNewImageToExistingImages.php +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsNewImageToExistingImages.php @@ -1,5 +1,9 @@ [ [ @@ -7,7 +11,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', 'extension' => 'jpg', 'name' => 'theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', @@ -20,7 +24,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/tueftlerzeit-sfz-rudolstadt-jpg.jpg', 'extension' => 'jpg', 'name' => 'tueftlerzeit-sfz-rudolstadt-jpg.jpg', @@ -33,7 +37,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/lutherkirche-jpg.jpg', 'extension' => 'jpg', 'name' => 'lutherkirche-jpg.jpg', @@ -51,7 +55,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 1, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, @@ -64,7 +67,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 3, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, @@ -77,7 +79,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 2, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsNewImages.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsNewImages.php index 6c866ed0..1368ca54 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsNewImages.php +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsNewImages.php @@ -1,5 +1,9 @@ [ [ @@ -7,7 +11,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', 'extension' => 'jpg', 'name' => 'theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', @@ -17,7 +21,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/tueftlerzeit-sfz-rudolstadt-jpg.jpg', 'extension' => 'jpg', 'name' => 'tueftlerzeit-sfz-rudolstadt-jpg.jpg', @@ -27,7 +31,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/lutherkirche-jpg.jpg', 'extension' => 'jpg', 'name' => 'lutherkirche-jpg.jpg', @@ -42,7 +46,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 1, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, @@ -55,7 +58,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 1, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, @@ -68,7 +70,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 1, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesRemovesNoLongerExistingImages.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesRemovesNoLongerExistingImages.php index a0117055..37a3a34e 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesRemovesNoLongerExistingImages.php +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesRemovesNoLongerExistingImages.php @@ -1,5 +1,9 @@ [ [ @@ -7,7 +11,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', 'extension' => 'jpg', 'name' => 'theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', @@ -17,7 +21,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/tueftlerzeit-sfz-rudolstadt-jpg.jpg', 'extension' => 'jpg', 'name' => 'tueftlerzeit-sfz-rudolstadt-jpg.jpg', @@ -32,7 +36,6 @@ 'tablenames' => '', 'fieldname' => '', 'sorting_foreign' => 0, - 'table_local' => '', 'title' => null, 'description' => null, 'alternative' => null, @@ -45,7 +48,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 1, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesUpdatesExistingImage.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesUpdatesExistingImage.php index ac102f4a..dcd05028 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesUpdatesExistingImage.php +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesUpdatesExistingImage.php @@ -1,5 +1,9 @@ [ [ @@ -7,7 +11,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', 'extension' => 'jpg', 'name' => 'theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', @@ -17,7 +21,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/tueftlerzeit-sfz-rudolstadt-jpg.jpg', 'extension' => 'jpg', 'name' => 'tueftlerzeit-sfz-rudolstadt-jpg.jpg', @@ -32,7 +36,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 1, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, @@ -45,7 +48,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 2, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesUpdatesSortingOfImages.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesUpdatesSortingOfImages.php index 97b3f65b..9baee81d 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesUpdatesSortingOfImages.php +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesUpdatesSortingOfImages.php @@ -1,5 +1,9 @@ [ [ @@ -7,7 +11,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', 'extension' => 'jpg', 'name' => 'theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', @@ -17,7 +21,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/tueftlerzeit-sfz-rudolstadt-jpg.jpg', 'extension' => 'jpg', 'name' => 'tueftlerzeit-sfz-rudolstadt-jpg.jpg', @@ -32,7 +36,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 2, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, @@ -45,7 +48,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 1, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsAllConfiguration.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsAllConfiguration.php new file mode 100644 index 00000000..c1419456 --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsAllConfiguration.php @@ -0,0 +1,886 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Schillerhaus Rudolstadt', + 'street' => 'Schillerstraße 25', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '+ 49 3672 / 486470', + 'web' => 'http://schillerhaus.rudolstadt.de', + 'email' => 'schillerhaus@rudolstadt.de', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Stadtbibliothek Rudolstadt', + 'street' => 'Schulplatz 13', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '0 36 72 - 48 64 20', + 'web' => 'http://www.stadtbibliothek-rudolstadt.de ', + 'email' => 'stadtbibliothek@rudolstadt.de', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Lutherkirche', + 'street' => 'Caspar-Schulte-Straße', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '03672 - 48 96 13', + 'web' => '', + 'email' => '', + ], + 3 => [ + 'uid' => '4', + 'pid' => '3', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Schillerhaus Rudolstadt', + 'street' => 'Schillerstraße 25', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '+ 49 3672 / 486470', + 'web' => 'http://schillerhaus.rudolstadt.de', + 'email' => 'schillerhaus@rudolstadt.de', + ], + 4 => [ + 'uid' => '5', + 'pid' => '3', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Stadtbibliothek Rudolstadt', + 'street' => 'Schulplatz 13', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '0 36 72 - 48 64 20', + 'web' => 'http://www.stadtbibliothek-rudolstadt.de ', + 'email' => 'stadtbibliothek@rudolstadt.de', + ], + 5 => [ + 'uid' => '6', + 'pid' => '3', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Lutherkirche', + 'street' => 'Caspar-Schulte-Straße', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '03672 - 48 96 13', + 'web' => '', + 'email' => '', + ], + ], + 'tx_events_domain_model_event' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Allerlei Weihnachtliches (Heute mit Johannes Geißer)', + 'subtitle' => '', + 'global_id' => 'e_100347853', + 'highlight' => '0', + 'teaser' => '', + 'images' => '1', + 'categories' => '1', + 'pages' => '', + 'dates' => '1', + 'organizer' => '1', + 'partner' => '', + 'region' => '1', + 'references_events' => '', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Tüftlerzeit', + 'subtitle' => '', + 'global_id' => 'e_100354481', + 'highlight' => '0', + 'teaser' => '', + 'images' => '1', + 'categories' => '1', + 'pages' => '', + 'dates' => '4', + 'organizer' => '2', + 'partner' => '', + 'region' => '1', + 'references_events' => '', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Adventliche Orgelmusik (Orgel: KMD Frank Bettenhausen)', + 'subtitle' => '', + 'global_id' => 'e_100350503', + 'highlight' => '0', + 'teaser' => '', + 'images' => '1', + 'categories' => '2', + 'pages' => '', + 'dates' => '8', + 'organizer' => '3', + 'partner' => '', + 'region' => '1', + 'references_events' => '', + ], + 3 => [ + 'uid' => '4', + 'pid' => '3', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Allerlei Weihnachtliches (Heute mit Johannes Geißer)', + 'subtitle' => '', + 'global_id' => 'e_100347853', + 'highlight' => '0', + 'teaser' => '', + 'images' => '1', + 'categories' => '1', + 'pages' => '', + 'dates' => '1', + 'organizer' => '4', + 'partner' => '', + 'region' => '1', + 'references_events' => '', + ], + 4 => [ + 'uid' => '5', + 'pid' => '3', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Tüftlerzeit', + 'subtitle' => '', + 'global_id' => 'e_100354481', + 'highlight' => '0', + 'teaser' => '', + 'images' => '1', + 'categories' => '1', + 'pages' => '', + 'dates' => '4', + 'organizer' => '5', + 'partner' => '', + 'region' => '1', + 'references_events' => '', + ], + 5 => [ + 'uid' => '6', + 'pid' => '3', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Adventliche Orgelmusik (Orgel: KMD Frank Bettenhausen)', + 'subtitle' => '', + 'global_id' => 'e_100350503', + 'highlight' => '0', + 'teaser' => '', + 'images' => '1', + 'categories' => '2', + 'pages' => '', + 'dates' => '8', + 'organizer' => '6', + 'partner' => '', + 'region' => '1', + 'references_events' => '', + ], + ], + 'tx_events_domain_model_date' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '1', + 'start' => '1671458400', + 'end' => '1671463800', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '2', + 'start' => '1671199200', + 'end' => '1671204600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '2', + 'start' => '1648803600', + 'end' => '1648810800', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 3 => [ + 'uid' => '4', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '2', + 'start' => '1648890000', + 'end' => '1648897200', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 4 => [ + 'uid' => '5', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '2', + 'start' => '1645106400', + 'end' => '1645113600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 5 => [ + 'uid' => '6', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1669917600', + 'end' => '1669921200', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 6 => [ + 'uid' => '7', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1667642400', + 'end' => '1667649600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 7 => [ + 'uid' => '8', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1668247200', + 'end' => '1668254400', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 8 => [ + 'uid' => '9', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1668852000', + 'end' => '1668859200', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 9 => [ + 'uid' => '10', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1667728800', + 'end' => '1667736000', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 10 => [ + 'uid' => '11', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1668333600', + 'end' => '1668340800', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 11 => [ + 'uid' => '12', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1668938400', + 'end' => '1668945600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 12 => [ + 'uid' => '13', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1671732000', + 'end' => '1671735600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 13 => [ + 'uid' => '14', + 'pid' => '3', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '4', + 'start' => '1671458400', + 'end' => '1671463800', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 14 => [ + 'uid' => '15', + 'pid' => '3', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '5', + 'start' => '1671199200', + 'end' => '1671204600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 15 => [ + 'uid' => '16', + 'pid' => '3', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '5', + 'start' => '1648803600', + 'end' => '1648810800', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 16 => [ + 'uid' => '17', + 'pid' => '3', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '5', + 'start' => '1648890000', + 'end' => '1648897200', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 17 => [ + 'uid' => '18', + 'pid' => '3', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '5', + 'start' => '1645106400', + 'end' => '1645113600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 18 => [ + 'uid' => '19', + 'pid' => '3', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '6', + 'start' => '1669917600', + 'end' => '1669921200', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 19 => [ + 'uid' => '20', + 'pid' => '3', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '6', + 'start' => '1667642400', + 'end' => '1667649600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 20 => [ + 'uid' => '21', + 'pid' => '3', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '6', + 'start' => '1668247200', + 'end' => '1668254400', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 21 => [ + 'uid' => '22', + 'pid' => '3', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '6', + 'start' => '1668852000', + 'end' => '1668859200', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 22 => [ + 'uid' => '23', + 'pid' => '3', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '6', + 'start' => '1667728800', + 'end' => '1667736000', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 23 => [ + 'uid' => '24', + 'pid' => '3', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '6', + 'start' => '1668333600', + 'end' => '1668340800', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 24 => [ + 'uid' => '25', + 'pid' => '3', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '6', + 'start' => '1668938400', + 'end' => '1668945600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + 25 => [ + 'uid' => '26', + 'pid' => '3', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '6', + 'start' => '1671732000', + 'end' => '1671735600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + ], + ], + 'sys_category' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '0', + 'l10n_parent' => '0', + 'title' => 'Top Category', + 'items' => '0', + 'parent' => '0', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '0', + 'l10n_parent' => '0', + 'title' => 'Event Category Parent', + 'items' => '0', + 'parent' => '1', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '0', + 'l10n_parent' => '0', + 'title' => 'Weihnachten', + 'items' => '0', + 'parent' => '2', + ], + 3 => [ + 'uid' => '4', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '0', + 'l10n_parent' => '0', + 'title' => 'Kinder', + 'items' => '0', + 'parent' => '2', + ], + 4 => [ + 'uid' => '5', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '0', + 'l10n_parent' => '0', + 'title' => 'Konzerte, Festivals, Show & Tanz', + 'items' => '0', + 'parent' => '2', + ], + ], + 'sys_category_record_mm' => [ + 0 => [ + 'uid_local' => '3', + 'uid_foreign' => '1', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'categories', + ], + 1 => [ + 'uid_local' => '4', + 'uid_foreign' => '2', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'categories', + ], + 2 => [ + 'uid_local' => '5', + 'uid_foreign' => '3', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'categories', + ], + 3 => [ + 'uid_local' => '3', + 'uid_foreign' => '3', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'categories', + ], + 4 => [ + 'uid_local' => '3', + 'uid_foreign' => '4', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'categories', + ], + 5 => [ + 'uid_local' => '4', + 'uid_foreign' => '5', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'categories', + ], + 6 => [ + 'uid_local' => '5', + 'uid_foreign' => '6', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'categories', + ], + 7 => [ + 'uid_local' => '3', + 'uid_foreign' => '6', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'categories', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsAllConfigurationTest.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsAllConfigurationTest.csv deleted file mode 100644 index 52bd014f..00000000 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsAllConfigurationTest.csv +++ /dev/null @@ -1,61 +0,0 @@ -"tx_events_domain_model_organizer",,,,,,,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","deleted","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","t3ver_stage","name","street","district","city","zip","phone","web","email",,,,, -,"1","2","0","0","0","0","0","-1","0","0","0","0","0","Schillerhaus Rudolstadt","Schillerstraße 25",,"Rudolstadt","07407","+ 49 3672 / 486470","http://schillerhaus.rudolstadt.de","schillerhaus@rudolstadt.de",,,,, -,"2","2","0","0","0","0","0","-1","0","0","0","0","0","Stadtbibliothek Rudolstadt","Schulplatz 13",,"Rudolstadt","07407","0 36 72 - 48 64 20","http://www.stadtbibliothek-rudolstadt.de ","stadtbibliothek@rudolstadt.de",,,,, -,"3","2","0","0","0","0","0","-1","0","0","0","0","0","Lutherkirche","Caspar-Schulte-Straße",,"Rudolstadt","07407","03672 - 48 96 13",,,,,,, -,"4","3","0","0","0","0","0","-1","0","0","0","0","0","Schillerhaus Rudolstadt","Schillerstraße 25",,"Rudolstadt","07407","+ 49 3672 / 486470","http://schillerhaus.rudolstadt.de","schillerhaus@rudolstadt.de",,,,, -,"5","3","0","0","0","0","0","-1","0","0","0","0","0","Stadtbibliothek Rudolstadt","Schulplatz 13",,"Rudolstadt","07407","0 36 72 - 48 64 20","http://www.stadtbibliothek-rudolstadt.de ","stadtbibliothek@rudolstadt.de",,,,, -,"6","3","0","0","0","0","0","-1","0","0","0","0","0","Lutherkirche","Caspar-Schulte-Straße",,"Rudolstadt","07407","03672 - 48 96 13",,,,,,, -"tx_events_domain_model_event",,,,,,,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","deleted","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","t3ver_stage","title","subtitle","global_id","highlight","teaser","images","categories","pages","dates","organizer","partner","region","references_events" -,"1","2","0","0","0","0","0","-1","0","0","0","0","0","Allerlei Weihnachtliches (Heute mit Johannes Geißer)",,"e_100347853","0",,"1","1",,"1","1",,"1", -,"2","2","0","0","0","0","0","-1","0","0","0","0","0","Tüftlerzeit",,"e_100354481","0",,"1","1",,"4","2",,"1", -,"3","2","0","0","0","0","0","-1","0","0","0","0","0","Adventliche Orgelmusik (Orgel: KMD Frank Bettenhausen)",,"e_100350503","0",,"1","2",,"8","3",,"1", -,"4","3","0","0","0","0","0","-1","0","0","0","0","0","Allerlei Weihnachtliches (Heute mit Johannes Geißer)",,"e_100347853","0",,"1","1",,"1","4",,"1", -,"5","3","0","0","0","0","0","-1","0","0","0","0","0","Tüftlerzeit",,"e_100354481","0",,"1","1",,"4","5",,"1", -,"6","3","0","0","0","0","0","-1","0","0","0","0","0","Adventliche Orgelmusik (Orgel: KMD Frank Bettenhausen)",,"e_100350503","0",,"1","2",,"8","6",,"1", -"tx_events_domain_model_date",,,,,,,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","event","start","end","canceled","postponed_date","canceled_link",,,,,,,,, -,"1","2","0","0","0","0",-1,0,"0","0","0","1","1671458400","1671463800","no","0",,,,,,,,,, -,"2","2","0","0","0","0",-1,0,"0","0","0","2","1671199200","1671204600","no","0",,,,,,,,,, -,"3","2","0","0","0","0",-1,0,"0","0","0","2",1648803600,1648810800,"no","0",,,,,,,,,, -,"4","2","0","0","0","0",-1,0,"0","0","0","2",1648890000,1648897200,"no","0",,,,,,,,,, -,"5","2","0","0","0","0",-1,0,"0","0","0","2","1645106400","1645113600","no","0",,,,,,,,,, -,"6","2","0","0","0","0",-1,0,"0","0","0","3","1669917600","1669921200","no","0",,,,,,,,,, -,"7","2","0","0","0","0",-1,0,"0","0","0","3","1667642400","1667649600","no","0",,,,,,,,,, -,"8","2","0","0","0","0",-1,0,"0","0","0","3","1668247200","1668254400","no","0",,,,,,,,,, -,"9","2","0","0","0","0",-1,0,"0","0","0","3","1668852000","1668859200","no","0",,,,,,,,,, -,"10","2","0","0","0","0",-1,0,"0","0","0","3","1667728800","1667736000","no","0",,,,,,,,,, -,"11","2","0","0","0","0",-1,0,"0","0","0","3","1668333600","1668340800","no","0",,,,,,,,,, -,"12","2","0","0","0","0",-1,0,"0","0","0","3","1668938400","1668945600","no","0",,,,,,,,,, -,"13","2","0","0","0","0",-1,0,"0","0","0","3","1671732000","1671735600","no","0",,,,,,,,,, -,"14","3","0","0","0","0",-1,0,"0","0","0","4","1671458400","1671463800","no","0",,,,,,,,,, -,"15","3","0","0","0","0",-1,0,"0","0","0","5","1671199200","1671204600","no","0",,,,,,,,,, -,"16","3","0","0","0","0",-1,0,"0","0","0","5",1648803600,1648810800,"no","0",,,,,,,,,, -,"17","3","0","0","0","0",-1,0,"0","0","0","5",1648890000,1648897200,"no","0",,,,,,,,,, -,"18","3","0","0","0","0",-1,0,"0","0","0","5","1645106400","1645113600","no","0",,,,,,,,,, -,"19","3","0","0","0","0",-1,0,"0","0","0","6","1669917600","1669921200","no","0",,,,,,,,,, -,"20","3","0","0","0","0",-1,0,"0","0","0","6","1667642400","1667649600","no","0",,,,,,,,,, -,"21","3","0","0","0","0",-1,0,"0","0","0","6","1668247200","1668254400","no","0",,,,,,,,,, -,"22","3","0","0","0","0",-1,0,"0","0","0","6","1668852000","1668859200","no","0",,,,,,,,,, -,"23","3","0","0","0","0",-1,0,"0","0","0","6","1667728800","1667736000","no","0",,,,,,,,,, -,"24","3","0","0","0","0",-1,0,"0","0","0","6","1668333600","1668340800","no","0",,,,,,,,,, -,"25","3","0","0","0","0",-1,0,"0","0","0","6","1668938400","1668945600","no","0",,,,,,,,,, -,"26","3","0","0","0","0",-1,0,"0","0","0","6","1671732000","1671735600","no","0",,,,,,,,,, -"sys_category",,,,,,,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","hidden","starttime","endtime","sys_language_uid","l10n_parent","title","items","parent",,,,,,,,,,,,,,, -,1,2,0,0,0,0,0,0,"Top Category",0,0,,,,,,,,,,,,,,, -,2,2,0,0,0,0,0,0,"Event Category Parent",0,1,,,,,,,,,,,,,,, -,3,2,0,0,0,0,0,0,"Weihnachten",0,2,,,,,,,,,,,,,,, -,4,2,0,0,0,0,0,0,"Kinder",0,2,,,,,,,,,,,,,,, -,5,2,0,0,0,0,0,0,"Konzerte, Festivals, Show & Tanz",0,2,,,,,,,,,,,,,,, -"sys_category_record_mm",,,,,,,,,,,,,,,,,,,,,,,,,, -,"uid_local","uid_foreign","tablenames","fieldname",,,,,,,,,,,,,,,,,,,,,, -,3,1,"tx_events_domain_model_event","categories",,,,,,,,,,,,,,,,,,,,,, -,4,2,"tx_events_domain_model_event","categories",,,,,,,,,,,,,,,,,,,,,, -,5,3,"tx_events_domain_model_event","categories",,,,,,,,,,,,,,,,,,,,,, -,3,3,"tx_events_domain_model_event","categories",,,,,,,,,,,,,,,,,,,,,, -,3,4,"tx_events_domain_model_event","categories",,,,,,,,,,,,,,,,,,,,,, -,4,5,"tx_events_domain_model_event","categories",,,,,,,,,,,,,,,,,,,,,, -,5,6,"tx_events_domain_model_event","categories",,,,,,,,,,,,,,,,,,,,,, -,3,6,"tx_events_domain_model_event","categories",,,,,,,,,,,,,,,,,,,,,, diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv deleted file mode 100644 index f3376db7..00000000 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv +++ /dev/null @@ -1,49 +0,0 @@ -"tx_events_domain_model_organizer",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","deleted","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","t3ver_stage","name","street","district","city","zip","phone","web","email",,,,,,,,,,,,,,, -,"1","2","0","0","0","0","0","-1","0","0","0","0","0","Schillerhaus Rudolstadt","Schillerstraße 25",,"Rudolstadt","07407","+ 49 3672 / 486470","http://schillerhaus.rudolstadt.de","schillerhaus@rudolstadt.de",,,,,,,,,,,,,,, -,"2","2","0","0","0","0","0","-1","0","0","0","0","0","Stadtbibliothek Rudolstadt","Schulplatz 13",,"Rudolstadt","07407","0 36 72 - 48 64 20","http://www.stadtbibliothek-rudolstadt.de ","stadtbibliothek@rudolstadt.de",,,,,,,,,,,,,,, -,"3","2","0","0","0","0","0","-1","0","0","0","0","0","Lutherkirche","Caspar-Schulte-Straße",,"Rudolstadt","07407","03672 - 48 96 13",,,,,,,,,,,,,,,,, -"tx_events_domain_model_event",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","deleted","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","t3ver_stage","title","subtitle","global_id","slug","highlight","teaser","details","price_info","web","ticket","facebook","youtube","instagram","images","categories","pages","dates","organizer","partner","region","references_events","location","slug" -,"1","2","0","0","0","0","0","-1","0","0","0","0","0","Allerlei Weihnachtliches (Heute mit Johannes Geißer)",,"e_100347853","e-100347853","0",,"Die Lichter sind entzündet, die Plätzchen duften, man rückt endlich wieder näher zusammen und lauscht den Geschichten. Vier Schauspieler*innen unseres Theaters überraschen mit ihren weihnachtlichen Texten, die sie für uns ausgewählt haben. Dazu plaudern sie über persönliche Anekdoten und erinnern sich an ihre schönsten und verrücktesten Weihnachtsfeste. Und da der Genuss in der Vorweihnachtszeit nicht fehlen darf, wird an jedem Adventssonntag eine andere weihnachtliche Spezialität serviert. -Eintritt: 10 € (inkl. Gedeck mit weihnachtlicher Schillerlocke) -Um Voranmeldung unter 03672-486470 oder schillerhaus@rudolstadt.de wird gebeten. -Es gilt die 2G-PLUS-Regel.",,"http://www.schillerhaus.rudolstadt.de/",,,,,"1","1",,"1","1",,"1",,1,"allerlei-weihnachtliches-heute-mit-johannes-geisser" -,"2","2","0","0","0","0","0","-1","0","0","0","0","0","Tüftlerzeit",,"e_100354481","e-100354481","0",,"Die Tüftlerzeit wird dieses Mal ein weihnachtliches Angebot bereithalten. Alle kleinen Tüftler dürfen gespannt sein. -Voranmeldung über: kinderbibliothek@rudolstadt.de oder 03672-486420 -Bitte beachten Sie die derzeit geltenden Zugangsregeln.",,"http://www.stadtbibliothek-rudolstadt.de/",,,,,"1","1",,"4","2",,"1",,2,"tueftlerzeit" -,"3","2","0","0","0","0","0","-1","0","0","0","0","0","Adventliche Orgelmusik (Orgel: KMD Frank Bettenhausen)",,"e_100350503","e-100350503","0",,"Immer mittwochs in der Adventszeit spielt Frank Bettenhausen solo und zusammen mit anderen Musikern auf der Steinmeyerorgel aus dem Jahr 1906. Bekannte Adventslieder, barocke und romantische Kompositionen stehen neben besinnlichen Texten von Pfarrer Johannes-Martin Weiss. -Es gilt die 2G-PLUS-Regel.",,,,,,,"1","2",,"8","3",,"1",,3,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen" -"tx_events_domain_model_date",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","event","start","end","canceled","postponed_date","canceled_link","slug",,,,,,,,,,,,,,,,,, -,"1","2","0","0","0","0",-1,0,"0","0","0","1","1671458400","1671463800","no","0",,"allerlei-weihnachtliches-heute-mit-johannes-geisser-2022-12-19t14-00-00",,,,,,,,,,,,,,,,,, -,"2","2","0","0","0","0",-1,0,"0","0","0","2","1671199200","1671204600","no","0",,"tueftlerzeit-2022-12-16t14-00-00",,,,,,,,,,,,,,,,,, -,"3","2","0","0","0","0",-1,0,"0","0","0","2",1648803600,1648810800,"no","0",,"tueftlerzeit-2022-04-01t09-00-00",,,,,,,,,,,,,,,,,, -,"4","2","0","0","0","0",-1,0,"0","0","0","2",1648890000,1648897200,"no","0",,"tueftlerzeit-2022-04-02t09-00-00",,,,,,,,,,,,,,,,,, -,"5","2","0","0","0","0",-1,0,"0","0","0","2","1645106400","1645113600","no","0",,"tueftlerzeit-2022-02-17t14-00-00",,,,,,,,,,,,,,,,,, -,"6","2","0","0","0","0",-1,0,"0","0","0","3","1669917600","1669921200","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-12-01t18-00-00",,,,,,,,,,,,,,,,,, -,"7","2","0","0","0","0",-1,0,"0","0","0","3","1667642400","1667649600","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-05t10-00-00",,,,,,,,,,,,,,,,,, -,"8","2","0","0","0","0",-1,0,"0","0","0","3","1668247200","1668254400","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-12t10-00-00",,,,,,,,,,,,,,,,,, -,"9","2","0","0","0","0",-1,0,"0","0","0","3","1668852000","1668859200","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-19t10-00-00",,,,,,,,,,,,,,,,,, -,"10","2","0","0","0","0",-1,0,"0","0","0","3","1667728800","1667736000","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-06t10-00-00",,,,,,,,,,,,,,,,,, -,"11","2","0","0","0","0",-1,0,"0","0","0","3","1668333600","1668340800","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-13t10-00-00",,,,,,,,,,,,,,,,,, -,"12","2","0","0","0","0",-1,0,"0","0","0","3","1668938400","1668945600","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-20t10-00-00",,,,,,,,,,,,,,,,,, -,"13","2","0","0","0","0",-1,0,"0","0","0","3","1671732000","1671735600","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-12-22t18-00-00",,,,,,,,,,,,,,,,,, -"tx_events_domain_model_location",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","name","street","district","city","zip","country","latitude","longitude","phone",,,,,,,,,,,,,,,, -,"1","2","0","0","0","0",-1,0,"0","0","0","Schillerhaus Rudolstadt","Schillerstraße 25",,"Rudolstadt","07407","Deutschland","50.720971","11.335230","+ 49 3672 / 486470",,,,,,,,,,,,,,,, -,"2","2","0","0","0","0",-1,0,"0","0","0","Stadtbibliothek Rudolstadt","Schulplatz 13",,"Rudolstadt","07407","Deutschland","50.720835","11.342568","0 36 72 - 48 64 20",,,,,,,,,,,,,,,, -,"3","2","0","0","0","0",-1,0,"0","0","0","Lutherkirche","Caspar-Schulte-Straße",,"Rudolstadt","07407","Deutschland","50.718689","11.327333","03672 - 48 96 13",,,,,,,,,,,,,,,, -"sys_category",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","hidden","starttime","endtime","sys_language_uid","l10n_parent","title","items","parent",,,,,,,,,,,,,,,,,,,,,,,,, -,1,2,0,0,0,0,0,0,"Top Category",0,0,,,,,,,,,,,,,,,,,,,,,,,,, -,2,2,0,0,0,0,0,0,"Event Category Parent",0,1,,,,,,,,,,,,,,,,,,,,,,,,, -,3,2,0,0,0,0,0,0,"Weihnachten",0,2,,,,,,,,,,,,,,,,,,,,,,,,, -,4,2,0,0,0,0,0,0,"Kinder",0,2,,,,,,,,,,,,,,,,,,,,,,,,, -,5,2,0,0,0,0,0,0,"Konzerte, Festivals, Show & Tanz",0,2,,,,,,,,,,,,,,,,,,,,,,,,, -"sys_category_record_mm",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -,"uid_local","uid_foreign","tablenames","fieldname",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -,3,1,"tx_events_domain_model_event","categories",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -,4,2,"tx_events_domain_model_event","categories",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -,5,3,"tx_events_domain_model_event","categories",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -,3,3,"tx_events_domain_model_event","categories",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.php new file mode 100644 index 00000000..9808e558 --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.php @@ -0,0 +1,598 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Schillerhaus Rudolstadt', + 'street' => 'Schillerstraße 25', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '+ 49 3672 / 486470', + 'web' => 'http://schillerhaus.rudolstadt.de', + 'email' => 'schillerhaus@rudolstadt.de', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Stadtbibliothek Rudolstadt', + 'street' => 'Schulplatz 13', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '0 36 72 - 48 64 20', + 'web' => 'http://www.stadtbibliothek-rudolstadt.de ', + 'email' => 'stadtbibliothek@rudolstadt.de', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Lutherkirche', + 'street' => 'Caspar-Schulte-Straße', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '03672 - 48 96 13', + 'web' => '', + 'email' => '', + ], + ], + 'tx_events_domain_model_event' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Allerlei Weihnachtliches (Heute mit Johannes Geißer)', + 'subtitle' => '', + 'global_id' => 'e_100347853', + 'slug' => 'allerlei-weihnachtliches-heute-mit-johannes-geisser', + 'highlight' => '0', + 'teaser' => '', + 'details' => implode(PHP_EOL, [ + 'Die Lichter sind entzündet, die Plätzchen duften, man rückt endlich wieder näher zusammen und lauscht den Geschichten. Vier Schauspieler*innen unseres Theaters überraschen mit ihren weihnachtlichen Texten, die sie für uns ausgewählt haben. Dazu plaudern sie über persönliche Anekdoten und erinnern sich an ihre schönsten und verrücktesten Weihnachtsfeste. Und da der Genuss in der Vorweihnachtszeit nicht fehlen darf, wird an jedem Adventssonntag eine andere weihnachtliche Spezialität serviert.', + 'Eintritt: 10 € (inkl. Gedeck mit weihnachtlicher Schillerlocke)', + 'Um Voranmeldung unter 03672-486470 oder schillerhaus@rudolstadt.de wird gebeten.', + 'Es gilt die 2G-PLUS-Regel.', + ]), + 'price_info' => '', + 'web' => 'http://www.schillerhaus.rudolstadt.de/', + 'ticket' => '', + 'facebook' => '', + 'youtube' => '', + 'instagram' => '', + 'images' => '1', + 'categories' => '1', + 'pages' => '', + 'dates' => '1', + 'organizer' => '1', + 'partner' => '', + 'region' => '1', + 'references_events' => '', + 'location' => '1', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Tüftlerzeit', + 'subtitle' => '', + 'global_id' => 'e_100354481', + 'slug' => 'tueftlerzeit', + 'highlight' => '0', + 'teaser' => '', + 'details' => implode(PHP_EOL, [ + 'Die Tüftlerzeit wird dieses Mal ein weihnachtliches Angebot bereithalten. Alle kleinen Tüftler dürfen gespannt sein.', + 'Voranmeldung über: kinderbibliothek@rudolstadt.de oder 03672-486420', + 'Bitte beachten Sie die derzeit geltenden Zugangsregeln.', + ]), + 'price_info' => '', + 'web' => 'http://www.stadtbibliothek-rudolstadt.de/', + 'ticket' => '', + 'facebook' => '', + 'youtube' => '', + 'instagram' => '', + 'images' => '1', + 'categories' => '1', + 'pages' => '', + 'dates' => '4', + 'organizer' => '2', + 'partner' => '', + 'region' => '1', + 'references_events' => '', + 'location' => '2', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Adventliche Orgelmusik (Orgel: KMD Frank Bettenhausen)', + 'subtitle' => '', + 'global_id' => 'e_100350503', + 'slug' => 'adventliche-orgelmusik-orgel-kmd-frank-bettenhausen', + 'highlight' => '0', + 'teaser' => '', + 'details' => implode(PHP_EOL, [ + 'Immer mittwochs in der Adventszeit spielt Frank Bettenhausen solo und zusammen mit anderen Musikern auf der Steinmeyerorgel aus dem Jahr 1906. Bekannte Adventslieder, barocke und romantische Kompositionen stehen neben besinnlichen Texten von Pfarrer Johannes-Martin Weiss.', + 'Es gilt die 2G-PLUS-Regel.', + ]), + 'price_info' => '', + 'web' => '', + 'ticket' => '', + 'facebook' => '', + 'youtube' => '', + 'instagram' => '', + 'images' => '1', + 'categories' => '2', + 'pages' => '', + 'dates' => '8', + 'organizer' => '3', + 'partner' => '', + 'region' => '1', + 'references_events' => '', + 'location' => '3', + ], + ], + 'tx_events_domain_model_date' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '1', + 'start' => '1671458400', + 'end' => '1671463800', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + 'slug' => 'allerlei-weihnachtliches-heute-mit-johannes-geisser-2022-12-19t14-00-00', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '2', + 'start' => '1671199200', + 'end' => '1671204600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + 'slug' => 'tueftlerzeit-2022-12-16t14-00-00', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '2', + 'start' => '1648803600', + 'end' => '1648810800', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + 'slug' => 'tueftlerzeit-2022-04-01t09-00-00', + ], + 3 => [ + 'uid' => '4', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '2', + 'start' => '1648890000', + 'end' => '1648897200', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + 'slug' => 'tueftlerzeit-2022-04-02t09-00-00', + ], + 4 => [ + 'uid' => '5', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '2', + 'start' => '1645106400', + 'end' => '1645113600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + 'slug' => 'tueftlerzeit-2022-02-17t14-00-00', + ], + 5 => [ + 'uid' => '6', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1669917600', + 'end' => '1669921200', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + 'slug' => 'adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-12-01t18-00-00', + ], + 6 => [ + 'uid' => '7', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1667642400', + 'end' => '1667649600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + 'slug' => 'adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-05t10-00-00', + ], + 7 => [ + 'uid' => '8', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1668247200', + 'end' => '1668254400', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + 'slug' => 'adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-12t10-00-00', + ], + 8 => [ + 'uid' => '9', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1668852000', + 'end' => '1668859200', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + 'slug' => 'adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-19t10-00-00', + ], + 9 => [ + 'uid' => '10', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1667728800', + 'end' => '1667736000', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + 'slug' => 'adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-06t10-00-00', + ], + 10 => [ + 'uid' => '11', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1668333600', + 'end' => '1668340800', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + 'slug' => 'adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-13t10-00-00', + ], + 11 => [ + 'uid' => '12', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1668938400', + 'end' => '1668945600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + 'slug' => 'adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-20t10-00-00', + ], + 12 => [ + 'uid' => '13', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'event' => '3', + 'start' => '1671732000', + 'end' => '1671735600', + 'canceled' => 'no', + 'postponed_date' => '0', + 'canceled_link' => '', + 'slug' => 'adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-12-22t18-00-00', + ], + ], + 'tx_events_domain_model_location' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'name' => 'Schillerhaus Rudolstadt', + 'street' => 'Schillerstraße 25', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'country' => 'Deutschland', + 'latitude' => '50.720971', + 'longitude' => '11.335230', + 'phone' => '+ 49 3672 / 486470', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'name' => 'Stadtbibliothek Rudolstadt', + 'street' => 'Schulplatz 13', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'country' => 'Deutschland', + 'latitude' => '50.720835', + 'longitude' => '11.342568', + 'phone' => '0 36 72 - 48 64 20', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 'name' => 'Lutherkirche', + 'street' => 'Caspar-Schulte-Straße', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'country' => 'Deutschland', + 'latitude' => '50.718689', + 'longitude' => '11.327333', + 'phone' => '03672 - 48 96 13', + ], + ], + 'sys_category' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '0', + 'l10n_parent' => '0', + 'title' => 'Top Category', + 'items' => '0', + 'parent' => '0', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '0', + 'l10n_parent' => '0', + 'title' => 'Event Category Parent', + 'items' => '0', + 'parent' => '1', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '0', + 'l10n_parent' => '0', + 'title' => 'Weihnachten', + 'items' => '0', + 'parent' => '2', + ], + 3 => [ + 'uid' => '4', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '0', + 'l10n_parent' => '0', + 'title' => 'Kinder', + 'items' => '0', + 'parent' => '2', + ], + 4 => [ + 'uid' => '5', + 'pid' => '2', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '0', + 'l10n_parent' => '0', + 'title' => 'Konzerte, Festivals, Show & Tanz', + 'items' => '0', + 'parent' => '2', + ], + ], + 'sys_category_record_mm' => [ + 0 => [ + 'uid_local' => '3', + 'uid_foreign' => '1', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'categories', + ], + 1 => [ + 'uid_local' => '4', + 'uid_foreign' => '2', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'categories', + ], + 2 => [ + 'uid_local' => '5', + 'uid_foreign' => '3', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'categories', + ], + 3 => [ + 'uid_local' => '3', + 'uid_foreign' => '3', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'categories', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFeaturesAddsNewFeatures.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFeaturesAddsNewFeatures.csv deleted file mode 100644 index 5b3e33f9..00000000 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFeaturesAddsNewFeatures.csv +++ /dev/null @@ -1,29 +0,0 @@ -"tx_events_domain_model_event",,,,,, -,"uid","pid","features",,, -,1,2,6,,, -,2,2,4,,, -,3,2,0,,, -"sys_category",,,,,, -,"uid","pid","title","parent","hidden", -,1,2,"Top Category",0,0, -,2,2,"Event Category Parent",1,0, -,4,2,"Event Feature Parent",1,0, -,5,3,"vorhandenes Feature",4,1, -,6,3,"Barrierefrei",4,1, -,7,3,"Zielgruppe Jugendliche",4,1, -,8,3,"Karten an der Abendkasse",4,1, -,9,3,"Ausreichende Lüftung",4,1, -,10,3,"Beachtung der Hygienehinweise",4,1, -,11,3,"neues Feature",4,1, -"sys_category_record_mm",,,,,, -,"uid_local","uid_foreign","tablenames","fieldname","sorting","sorting_foreign" -,5,1,"tx_events_domain_model_event","features",0,1 -,6,1,"tx_events_domain_model_event","features",0,2 -,7,1,"tx_events_domain_model_event","features",0,3 -,8,1,"tx_events_domain_model_event","features",0,4 -,9,1,"tx_events_domain_model_event","features",0,5 -,10,1,"tx_events_domain_model_event","features",0,6 -,5,2,"tx_events_domain_model_event","features",0,1 -,6,2,"tx_events_domain_model_event","features",0,2 -,7,2,"tx_events_domain_model_event","features",0,3 -,11,2,"tx_events_domain_model_event","features",0,4 diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFeaturesAddsNewFeatures.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFeaturesAddsNewFeatures.php new file mode 100644 index 00000000..f25a5921 --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFeaturesAddsNewFeatures.php @@ -0,0 +1,177 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'features' => '6', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'features' => '4', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'features' => '0', + ], + ], + 'sys_category' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'title' => 'Top Category', + 'parent' => '0', + 'hidden' => '0', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'title' => 'Event Category Parent', + 'parent' => '1', + 'hidden' => '0', + ], + 2 => [ + 'uid' => '4', + 'pid' => '2', + 'title' => 'Event Feature Parent', + 'parent' => '1', + 'hidden' => '0', + ], + 3 => [ + 'uid' => '5', + 'pid' => '3', + 'title' => 'vorhandenes Feature', + 'parent' => '4', + 'hidden' => '1', + ], + 4 => [ + 'uid' => '6', + 'pid' => '3', + 'title' => 'Barrierefrei', + 'parent' => '4', + 'hidden' => '1', + ], + 5 => [ + 'uid' => '7', + 'pid' => '3', + 'title' => 'Zielgruppe Jugendliche', + 'parent' => '4', + 'hidden' => '1', + ], + 6 => [ + 'uid' => '8', + 'pid' => '3', + 'title' => 'Karten an der Abendkasse', + 'parent' => '4', + 'hidden' => '1', + ], + 7 => [ + 'uid' => '9', + 'pid' => '3', + 'title' => 'Ausreichende Lüftung', + 'parent' => '4', + 'hidden' => '1', + ], + 8 => [ + 'uid' => '10', + 'pid' => '3', + 'title' => 'Beachtung der Hygienehinweise', + 'parent' => '4', + 'hidden' => '1', + ], + 9 => [ + 'uid' => '11', + 'pid' => '3', + 'title' => 'neues Feature', + 'parent' => '4', + 'hidden' => '1', + ], + ], + 'sys_category_record_mm' => [ + 0 => [ + 'uid_local' => '5', + 'uid_foreign' => '1', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'features', + 'sorting' => '0', + 'sorting_foreign' => '1', + ], + 1 => [ + 'uid_local' => '6', + 'uid_foreign' => '1', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'features', + 'sorting' => '0', + 'sorting_foreign' => '2', + ], + 2 => [ + 'uid_local' => '7', + 'uid_foreign' => '1', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'features', + 'sorting' => '0', + 'sorting_foreign' => '3', + ], + 3 => [ + 'uid_local' => '8', + 'uid_foreign' => '1', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'features', + 'sorting' => '0', + 'sorting_foreign' => '4', + ], + 4 => [ + 'uid_local' => '9', + 'uid_foreign' => '1', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'features', + 'sorting' => '0', + 'sorting_foreign' => '5', + ], + 5 => [ + 'uid_local' => '10', + 'uid_foreign' => '1', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'features', + 'sorting' => '0', + 'sorting_foreign' => '6', + ], + 6 => [ + 'uid_local' => '5', + 'uid_foreign' => '2', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'features', + 'sorting' => '0', + 'sorting_foreign' => '1', + ], + 7 => [ + 'uid_local' => '6', + 'uid_foreign' => '2', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'features', + 'sorting' => '0', + 'sorting_foreign' => '2', + ], + 8 => [ + 'uid_local' => '7', + 'uid_foreign' => '2', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'features', + 'sorting' => '0', + 'sorting_foreign' => '3', + ], + 9 => [ + 'uid_local' => '11', + 'uid_foreign' => '2', + 'tablenames' => 'tx_events_domain_model_event', + 'fieldname' => 'features', + 'sorting' => '0', + 'sorting_foreign' => '4', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesDaily.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesDaily.csv deleted file mode 100644 index e5abe09d..00000000 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesDaily.csv +++ /dev/null @@ -1,10 +0,0 @@ -"tx_events_domain_model_event",,,,, -,"uid","pid","title","global_id","dates" -,"1","2","Kurzführung - Historische Altstadt","e_100354481",5 -"tx_events_domain_model_date",,,,, -,"uid","pid","event","start","end" -,"1","2",1,1657720800,1657724400 -,"2","2",1,1657807200,1657810800 -,"3","2",1,1657893600,1657897200 -,"4","2",1,1657980000,1657983600 -,"5","2",1,1658066400,1658070000 diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesDaily.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesDaily.php new file mode 100644 index 00000000..d74c2fc0 --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesDaily.php @@ -0,0 +1,52 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'title' => 'Kurzführung - Historische Altstadt', + 'global_id' => 'e_100354481', + 'dates' => '5', + ], + ], + 'tx_events_domain_model_date' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'event' => '1', + 'start' => '1657720800', + 'end' => '1657724400', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'event' => '1', + 'start' => '1657807200', + 'end' => '1657810800', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'event' => '1', + 'start' => '1657893600', + 'end' => '1657897200', + ], + 3 => [ + 'uid' => '4', + 'pid' => '2', + 'event' => '1', + 'start' => '1657980000', + 'end' => '1657983600', + ], + 4 => [ + 'uid' => '5', + 'pid' => '2', + 'event' => '1', + 'start' => '1658066400', + 'end' => '1658070000', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesWeekly.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesWeekly.csv deleted file mode 100644 index 90d51342..00000000 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesWeekly.csv +++ /dev/null @@ -1,8 +0,0 @@ -"tx_events_domain_model_event",,,,, -,"uid","pid","title","global_id","dates" -,"1","2","Tüftlerzeit","e_100354481",3 -"tx_events_domain_model_date",,,,, -,"uid","pid","event","start","end" -,"1","2",1,1657958400,1657980000 -,"2","2",1,1658563200,1658584800 -,"3","2",1,1659168000,1659189600 diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesWeekly.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesWeekly.php new file mode 100644 index 00000000..6dae444b --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesWeekly.php @@ -0,0 +1,38 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'title' => 'Tüftlerzeit', + 'global_id' => 'e_100354481', + 'dates' => '3', + ], + ], + 'tx_events_domain_model_date' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'event' => '1', + 'start' => '1657958400', + 'end' => '1657980000', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'event' => '1', + 'start' => '1658563200', + 'end' => '1658584800', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'event' => '1', + 'start' => '1659168000', + 'end' => '1659189600', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfSingleDate.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfSingleDate.csv deleted file mode 100644 index 3eb8b46a..00000000 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfSingleDate.csv +++ /dev/null @@ -1,6 +0,0 @@ -"tx_events_domain_model_event",,,,, -,"uid","pid","title","global_id","dates" -,"1","2","Kurzführung - Historische Altstadt","e_100354481",1 -"tx_events_domain_model_date",,,,, -,"uid","pid","event","start","end" -,"1","2",1,1657717200,1657722600 diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfSingleDate.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfSingleDate.php new file mode 100644 index 00000000..fb0dd96c --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfSingleDate.php @@ -0,0 +1,24 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'title' => 'Kurzführung - Historische Altstadt', + 'global_id' => 'e_100354481', + 'dates' => '1', + ], + ], + 'tx_events_domain_model_date' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'event' => '1', + 'start' => '1657717200', + 'end' => '1657722600', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesDailyWithConfiguredRepeatUntil.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesDailyWithConfiguredRepeatUntil.csv deleted file mode 100644 index 5d4bece2..00000000 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesDailyWithConfiguredRepeatUntil.csv +++ /dev/null @@ -1,15 +0,0 @@ -"tx_events_domain_model_event",,,,, -,"uid","pid","title","global_id","dates" -,"1","2","Kurzführung - Historische Altstadt","e_100354481",10 -"tx_events_domain_model_date",,,,, -,"uid","pid","event","start","end" -,"1","2",1,1657720800,1657724400 -,"2","2",1,1657807200,1657810800 -,"3","2",1,1657893600,1657897200 -,"4","2",1,1657980000,1657983600 -,"5","2",1,1658066400,1658070000 -,"6","2",1,1658152800,1658156400 -,"7","2",1,1658239200,1658242800 -,"8","2",1,1658325600,1658329200 -,"9","2",1,1658412000,1658415600 -,"10","2",1,1658498400,1658502000 diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesDailyWithConfiguredRepeatUntil.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesDailyWithConfiguredRepeatUntil.php new file mode 100644 index 00000000..7555e6b5 --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesDailyWithConfiguredRepeatUntil.php @@ -0,0 +1,87 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'title' => 'Kurzführung - Historische Altstadt', + 'global_id' => 'e_100354481', + 'dates' => '10', + ], + ], + 'tx_events_domain_model_date' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'event' => '1', + 'start' => '1657720800', + 'end' => '1657724400', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'event' => '1', + 'start' => '1657807200', + 'end' => '1657810800', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'event' => '1', + 'start' => '1657893600', + 'end' => '1657897200', + ], + 3 => [ + 'uid' => '4', + 'pid' => '2', + 'event' => '1', + 'start' => '1657980000', + 'end' => '1657983600', + ], + 4 => [ + 'uid' => '5', + 'pid' => '2', + 'event' => '1', + 'start' => '1658066400', + 'end' => '1658070000', + ], + 5 => [ + 'uid' => '6', + 'pid' => '2', + 'event' => '1', + 'start' => '1658152800', + 'end' => '1658156400', + ], + 6 => [ + 'uid' => '7', + 'pid' => '2', + 'event' => '1', + 'start' => '1658239200', + 'end' => '1658242800', + ], + 7 => [ + 'uid' => '8', + 'pid' => '2', + 'event' => '1', + 'start' => '1658325600', + 'end' => '1658329200', + ], + 8 => [ + 'uid' => '9', + 'pid' => '2', + 'event' => '1', + 'start' => '1658412000', + 'end' => '1658415600', + ], + 9 => [ + 'uid' => '10', + 'pid' => '2', + 'event' => '1', + 'start' => '1658498400', + 'end' => '1658502000', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesWeeklyWithConfiguredRepeatUntil.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesWeeklyWithConfiguredRepeatUntil.csv deleted file mode 100644 index 4005c029..00000000 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesWeeklyWithConfiguredRepeatUntil.csv +++ /dev/null @@ -1,9 +0,0 @@ -"tx_events_domain_model_event",,,,, -,"uid","pid","title","global_id","dates" -,"1","2","Tüftlerzeit","e_100354481",4 -"tx_events_domain_model_date",,,,, -,"uid","pid","event","start","end" -,"1","2",1,1657958400,1657980000 -,"2","2",1,1658563200,1658584800 -,"3","2",1,1659168000,1659189600 -,"4","2",1,1659772800,1659794400 diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesWeeklyWithConfiguredRepeatUntil.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesWeeklyWithConfiguredRepeatUntil.php new file mode 100644 index 00000000..b4493230 --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesWeeklyWithConfiguredRepeatUntil.php @@ -0,0 +1,45 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'title' => 'Tüftlerzeit', + 'global_id' => 'e_100354481', + 'dates' => '4', + ], + ], + 'tx_events_domain_model_date' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'event' => '1', + 'start' => '1657958400', + 'end' => '1657980000', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'event' => '1', + 'start' => '1658563200', + 'end' => '1658584800', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'event' => '1', + 'start' => '1659168000', + 'end' => '1659189600', + ], + 3 => [ + 'uid' => '4', + 'pid' => '2', + 'event' => '1', + 'start' => '1659772800', + 'end' => '1659794400', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsSource.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsSource.php index 3042079e..81e044c9 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsSource.php +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsSource.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsTickets.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsTickets.csv deleted file mode 100644 index 85511cb1..00000000 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsTickets.csv +++ /dev/null @@ -1,4 +0,0 @@ -"tx_events_domain_model_event",,,,, -,"uid","pid","title","global_id","ticket" -,"1","2","PRICE_KARTENLINK","e_100347853","https://www.ticketshop-thueringen.de/veranstaltungen/comedy/sonstiges/bodo-wartke-24230" -,"2","2","Booking","e_100354481","https://www.erfurt-tourismus.de/stadtfuehrung/individuell/altstadtfuehrung/onlinebuchung-altstadtfuehrung" diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsTickets.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsTickets.php new file mode 100644 index 00000000..c5d473a3 --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsTickets.php @@ -0,0 +1,22 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'title' => 'PRICE_KARTENLINK', + 'global_id' => 'e_100347853', + 'ticket' => 'https://www.ticketshop-thueringen.de/veranstaltungen/comedy/sonstiges/bodo-wartke-24230', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'title' => 'Booking', + 'global_id' => 'e_100354481', + 'ticket' => 'https://www.erfurt-tourismus.de/stadtfuehrung/individuell/altstadtfuehrung/onlinebuchung-altstadtfuehrung', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithLocations.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithLocations.php index 63feb36e..7a970512 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithLocations.php +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithLocations.php @@ -1,11 +1,12 @@ [ [ 'uid' => 1, 'pid' => 2, - 'cruser_id' => 0, 'hidden' => 0, 'starttime' => 0, 'endtime' => 0, @@ -28,7 +29,6 @@ [ 'uid' => 2, 'pid' => 2, - 'cruser_id' => 0, 'hidden' => 0, 'starttime' => 0, 'endtime' => 0, diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithSingleLocationOnDuplicates.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithSingleLocationOnDuplicates.php index a9573abb..e056dc81 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithSingleLocationOnDuplicates.php +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithSingleLocationOnDuplicates.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutCategoryIfNotProvided.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutCategoryIfNotProvided.csv deleted file mode 100644 index d7634be4..00000000 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutCategoryIfNotProvided.csv +++ /dev/null @@ -1,10 +0,0 @@ -"tx_events_domain_model_organizer",,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","deleted","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","t3ver_stage","name","street","district","city","zip","phone","web","email" -,"1","2","0","0","0","0","0","-1","0","0","0","0","0","Schillerhaus Rudolstadt","Schillerstraße 25",,"Rudolstadt","07407","+ 49 3672 / 486470","http://schillerhaus.rudolstadt.de","schillerhaus@rudolstadt.de" -,"2","2","0","0","0","0","0","-1","0","0","0","0","0","Stadtbibliothek Rudolstadt","Schulplatz 13",,"Rudolstadt","07407","0 36 72 - 48 64 20","http://www.stadtbibliothek-rudolstadt.de ","stadtbibliothek@rudolstadt.de" -,"3","2","0","0","0","0","0","-1","0","0","0","0","0","Lutherkirche","Caspar-Schulte-Straße",,"Rudolstadt","07407","03672 - 48 96 13",, -"tx_events_domain_model_event",,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","deleted","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","t3ver_stage","title","subtitle","global_id","highlight","teaser","categories",, -,"1","2","0","0","0","0","0","-1","0","0","0","0","0","Allerlei Weihnachtliches (Heute mit Johannes Geißer)",,"e_100347853","0",,"0",, -,"2","2","0","0","0","0","0","-1","0","0","0","0","0","Tüftlerzeit",,"e_100354481","0",,"0",, -,"3","2","0","0","0","0","0","-1","0","0","0","0","0","Adventliche Orgelmusik (Orgel: KMD Frank Bettenhausen)",,"e_100350503","0",,"0",, diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutCategoryIfNotProvided.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutCategoryIfNotProvided.php new file mode 100644 index 00000000..8b06550a --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutCategoryIfNotProvided.php @@ -0,0 +1,136 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Schillerhaus Rudolstadt', + 'street' => 'Schillerstraße 25', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '+ 49 3672 / 486470', + 'web' => 'http://schillerhaus.rudolstadt.de', + 'email' => 'schillerhaus@rudolstadt.de', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Stadtbibliothek Rudolstadt', + 'street' => 'Schulplatz 13', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '0 36 72 - 48 64 20', + 'web' => 'http://www.stadtbibliothek-rudolstadt.de ', + 'email' => 'stadtbibliothek@rudolstadt.de', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Lutherkirche', + 'street' => 'Caspar-Schulte-Straße', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '03672 - 48 96 13', + 'web' => '', + 'email' => '', + ], + ], + 'tx_events_domain_model_event' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Allerlei Weihnachtliches (Heute mit Johannes Geißer)', + 'subtitle' => '', + 'global_id' => 'e_100347853', + 'highlight' => '0', + 'teaser' => '', + 'categories' => '0', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Tüftlerzeit', + 'subtitle' => '', + 'global_id' => 'e_100354481', + 'highlight' => '0', + 'teaser' => '', + 'categories' => '0', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Adventliche Orgelmusik (Orgel: KMD Frank Bettenhausen)', + 'subtitle' => '', + 'global_id' => 'e_100350503', + 'highlight' => '0', + 'teaser' => '', + 'categories' => '0', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutLocationIfNotProvided.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutLocationIfNotProvided.csv deleted file mode 100644 index 334ef94c..00000000 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutLocationIfNotProvided.csv +++ /dev/null @@ -1,6 +0,0 @@ -"tx_events_domain_model_organizer",,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","deleted","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","t3ver_stage","name","street","district","city","zip","phone","web","email" -,"1","2","0","0","0","0","0","-1","0","0","0","0","0","Schillerhaus Rudolstadt","Schillerstraße 25",,"Rudolstadt","07407","+ 49 3672 / 486470","http://schillerhaus.rudolstadt.de","schillerhaus@rudolstadt.de" -"tx_events_domain_model_event",,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","deleted","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","t3ver_stage","title","subtitle","global_id","highlight","teaser","region",, -,"1","2","0","0","0","0","0","-1","0","0","0","0","0","Allerlei Weihnachtliches (Heute mit Johannes Geißer)",,"e_100347853","0",,"0",, diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutLocationIfNotProvided.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutLocationIfNotProvided.php new file mode 100644 index 00000000..0d68bc2f --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutLocationIfNotProvided.php @@ -0,0 +1,52 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Schillerhaus Rudolstadt', + 'street' => 'Schillerstraße 25', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '+ 49 3672 / 486470', + 'web' => 'http://schillerhaus.rudolstadt.de', + 'email' => 'schillerhaus@rudolstadt.de', + ], + ], + 'tx_events_domain_model_event' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Allerlei Weihnachtliches (Heute mit Johannes Geißer)', + 'subtitle' => '', + 'global_id' => 'e_100347853', + 'highlight' => '0', + 'teaser' => '', + 'region' => '0', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutRegionIfNotProvided.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutRegionIfNotProvided.csv deleted file mode 100644 index 359aaf88..00000000 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutRegionIfNotProvided.csv +++ /dev/null @@ -1,10 +0,0 @@ -"tx_events_domain_model_organizer",,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","deleted","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","t3ver_stage","name","street","district","city","zip","phone","web","email" -,"1","2","0","0","0","0","0","-1","0","0","0","0","0","Schillerhaus Rudolstadt","Schillerstraße 25",,"Rudolstadt","07407","+ 49 3672 / 486470","http://schillerhaus.rudolstadt.de","schillerhaus@rudolstadt.de" -,"2","2","0","0","0","0","0","-1","0","0","0","0","0","Stadtbibliothek Rudolstadt","Schulplatz 13",,"Rudolstadt","07407","0 36 72 - 48 64 20","http://www.stadtbibliothek-rudolstadt.de ","stadtbibliothek@rudolstadt.de" -,"3","2","0","0","0","0","0","-1","0","0","0","0","0","Lutherkirche","Caspar-Schulte-Straße",,"Rudolstadt","07407","03672 - 48 96 13",, -"tx_events_domain_model_event",,,,,,,,,,,,,,,,,,,,, -,"uid","pid","cruser_id","deleted","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","t3ver_stage","title","subtitle","global_id","highlight","teaser","region",, -,"1","2","0","0","0","0","0","-1","0","0","0","0","0","Allerlei Weihnachtliches (Heute mit Johannes Geißer)",,"e_100347853","0",,"0",, -,"2","2","0","0","0","0","0","-1","0","0","0","0","0","Tüftlerzeit",,"e_100354481","0",,"0",, -,"3","2","0","0","0","0","0","-1","0","0","0","0","0","Adventliche Orgelmusik (Orgel: KMD Frank Bettenhausen)",,"e_100350503","0",,"0",, diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutRegionIfNotProvided.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutRegionIfNotProvided.php new file mode 100644 index 00000000..affaac8f --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutRegionIfNotProvided.php @@ -0,0 +1,136 @@ + [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Schillerhaus Rudolstadt', + 'street' => 'Schillerstraße 25', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '+ 49 3672 / 486470', + 'web' => 'http://schillerhaus.rudolstadt.de', + 'email' => 'schillerhaus@rudolstadt.de', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Stadtbibliothek Rudolstadt', + 'street' => 'Schulplatz 13', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '0 36 72 - 48 64 20', + 'web' => 'http://www.stadtbibliothek-rudolstadt.de ', + 'email' => 'stadtbibliothek@rudolstadt.de', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'name' => 'Lutherkirche', + 'street' => 'Caspar-Schulte-Straße', + 'district' => '', + 'city' => 'Rudolstadt', + 'zip' => '07407', + 'phone' => '03672 - 48 96 13', + 'web' => '', + 'email' => '', + ], + ], + 'tx_events_domain_model_event' => [ + 0 => [ + 'uid' => '1', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Allerlei Weihnachtliches (Heute mit Johannes Geißer)', + 'subtitle' => '', + 'global_id' => 'e_100347853', + 'highlight' => '0', + 'teaser' => '', + 'region' => '0', + ], + 1 => [ + 'uid' => '2', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Tüftlerzeit', + 'subtitle' => '', + 'global_id' => 'e_100354481', + 'highlight' => '0', + 'teaser' => '', + 'region' => '0', + ], + 2 => [ + 'uid' => '3', + 'pid' => '2', + 'deleted' => '0', + 'hidden' => '0', + 'starttime' => '0', + 'endtime' => '0', + 'sys_language_uid' => '-1', + 'l10n_parent' => '0', + 't3ver_oid' => '0', + 't3ver_wsid' => '0', + 't3ver_state' => '0', + 't3ver_stage' => '0', + 'title' => 'Adventliche Orgelmusik (Orgel: KMD Frank Bettenhausen)', + 'subtitle' => '', + 'global_id' => 'e_100350503', + 'highlight' => '0', + 'teaser' => '', + 'region' => '0', + ], + ], +]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/UpdatesExistingLocation.php b/Tests/Functional/Import/DestinationDataTest/Assertions/UpdatesExistingLocation.php index 929b5b8d..1a409aa3 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/UpdatesExistingLocation.php +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/UpdatesExistingLocation.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/DefaultImportConfiguration.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/DefaultImportConfiguration.php index aa1cdca0..77fbfc52 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/DefaultImportConfiguration.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/DefaultImportConfiguration.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ExistingFeatures.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ExistingFeatures.php index 6a43fa23..7846aa2c 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ExistingFeatures.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ExistingFeatures.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ExistingLocation.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ExistingLocation.php index 7510c9af..85721f06 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ExistingLocation.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ExistingLocation.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/FeaturesImportConfiguration.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/FeaturesImportConfiguration.php index ecde4233..37a5e0ae 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/FeaturesImportConfiguration.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/FeaturesImportConfiguration.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/FirstDateOfRecurringDatesImportConfiguration.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/FirstDateOfRecurringDatesImportConfiguration.php index 99c92c2c..ff36a9d4 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/FirstDateOfRecurringDatesImportConfiguration.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/FirstDateOfRecurringDatesImportConfiguration.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ImportHandlesImagesExistingData.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ImportHandlesImagesExistingData.php index 2d6eaa65..79d11bb5 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ImportHandlesImagesExistingData.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ImportHandlesImagesExistingData.php @@ -1,5 +1,9 @@ [ [ @@ -7,7 +11,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', 'extension' => 'jpg', 'name' => 'theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', @@ -20,7 +24,7 @@ 'pid' => 0, 'missing' => 0, 'storage' => 1, - 'type' => \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE, + 'type' => File::FILETYPE_IMAGE, 'identifier' => '/staedte/beispielstadt/events/tueftlerzeit-sfz-rudolstadt-jpg.jpg', 'extension' => 'jpg', 'name' => 'tueftlerzeit-sfz-rudolstadt-jpg.jpg', @@ -38,7 +42,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 1, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, @@ -51,7 +54,6 @@ 'tablenames' => 'tx_events_domain_model_event', 'fieldname' => 'images', 'sorting_foreign' => 2, - 'table_local' => 'sys_file', 'title' => null, 'description' => null, 'alternative' => null, diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/MinimalImportConfiguration.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/MinimalImportConfiguration.php index 25f56513..8b1c6f81 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/MinimalImportConfiguration.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/MinimalImportConfiguration.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SecondImportConfiguration.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SecondImportConfiguration.php index 56a7f172..124ee4be 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SecondImportConfiguration.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SecondImportConfiguration.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleCategory.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleCategory.php index e407300a..aebebc3b 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleCategory.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleCategory.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleImportConfiguration.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleImportConfiguration.php index 31c1a13b..de61577a 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleImportConfiguration.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleImportConfiguration.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleImportConfigurationWithCategories.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleImportConfigurationWithCategories.php index 18966072..b078434c 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleImportConfigurationWithCategories.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleImportConfigurationWithCategories.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleImportConfigurationWithoutRegion.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleImportConfigurationWithoutRegion.php index d4938e2b..807c2078 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleImportConfigurationWithoutRegion.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleImportConfigurationWithoutRegion.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleRegion.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleRegion.php index 4da51822..0c374d00 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleRegion.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/SingleRegion.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/Structure.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/Structure.php index 27b5b638..d33d4e89 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/Structure.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/Structure.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Import/DestinationDataTest/ImportCleansTransientFilesTest.php b/Tests/Functional/Import/DestinationDataTest/ImportCleansTransientFilesTest.php index 3d9c79d4..61111886 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportCleansTransientFilesTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportCleansTransientFilesTest.php @@ -1,19 +1,19 @@ importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php'); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportDoesNotUseUploadsFolderTest.php b/Tests/Functional/Import/DestinationDataTest/ImportDoesNotUseUploadsFolderTest.php index b307affe..adadee0d 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportDoesNotUseUploadsFolderTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportDoesNotUseUploadsFolderTest.php @@ -1,19 +1,19 @@ importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php'); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportDoesntBreakWithLongFileTitleTest.php b/Tests/Functional/Import/DestinationDataTest/ImportDoesntBreakWithLongFileTitleTest.php index 168c414c..2a78075a 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportDoesntBreakWithLongFileTitleTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportDoesntBreakWithLongFileTitleTest.php @@ -1,14 +1,15 @@ importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleImportConfigurationWithCategories.php'); @@ -32,7 +33,7 @@ public function importsExampleAsExpected(): void self::assertSame(0, $tester->getStatusCode()); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportDoesntBreakWithLongFileTitle.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportDoesntBreakWithLongFileTitle.php'); $this->assertEmptyLog(); } } diff --git a/Tests/Functional/Import/DestinationDataTest/ImportDoesntEndUpInEndlessDateCreationTest.php b/Tests/Functional/Import/DestinationDataTest/ImportDoesntEndUpInEndlessDateCreationTest.php index 9baa6cca..0b69e672 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportDoesntEndUpInEndlessDateCreationTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportDoesntEndUpInEndlessDateCreationTest.php @@ -1,17 +1,19 @@ setDateAspect(new \DateTimeImmutable('2022-07-01'), new \DateTimeZone('Europe/Berlin')); + $this->setDateAspect(new DateTimeImmutable('2022-07-01')); $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php'); $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleRegion.php'); $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleCategory.php'); @@ -32,7 +34,7 @@ public function importsExampleAsExpected(): void self::assertSame(0, $tester->getStatusCode()); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportDoesntEndUpInEndlessDateCreationTest.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportDoesntEndUpInEndlessDateCreation.php'); $this->assertEmptyLog(); } } diff --git a/Tests/Functional/Import/DestinationDataTest/ImportHandlesImagesTest.php b/Tests/Functional/Import/DestinationDataTest/ImportHandlesImagesTest.php index 51073ee1..44c54c6c 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportHandlesImagesTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportHandlesImagesTest.php @@ -1,14 +1,16 @@ setUpResponses([ @@ -60,9 +60,7 @@ public function addsNewImages(): void $this->assertEmptyLog(); } - /** - * @test - */ + #[Test] public function addsMultipleImagesToSingleEvent(): void { $this->setUpResponses([ @@ -89,9 +87,7 @@ public function addsMultipleImagesToSingleEvent(): void $this->assertEmptyLog(); } - /** - * @test - */ + #[Test] public function removesNoLongerExistingImages(): void { $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/ImportHandlesImagesExistingData.php'); @@ -121,9 +117,7 @@ public function removesNoLongerExistingImages(): void $this->assertEmptyLog(); } - /** - * @test - */ + #[Test] public function updatesExistingImage(): void { $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/ImportHandlesImagesExistingData.php'); @@ -154,9 +148,7 @@ public function updatesExistingImage(): void $this->assertEmptyLog(); } - /** - * @test - */ + #[Test] public function addsNewImageToExistingImages(): void { $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/ImportHandlesImagesExistingData.php'); @@ -189,9 +181,7 @@ public function addsNewImageToExistingImages(): void $this->assertEmptyLog(); } - /** - * @test - */ + #[Test] public function updatesSortingOfImages(): void { $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/ImportHandlesImagesExistingData.php'); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsAllConfigurationTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsAllConfigurationTest.php index f7f4ef7d..b1b53260 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsAllConfigurationTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsAllConfigurationTest.php @@ -1,22 +1,24 @@ setDateAspect(new \DateTimeImmutable('2021-07-13', new \DateTimeZone('Europe/Berlin'))); + $this->setDateAspect(new DateTimeImmutable('2021-07-13', new DateTimeZone('Europe/Berlin'))); $fileImportPathConfiguration2 = 'staedte/anderestadt/events/'; $fileImportPath2 = $this->getInstancePath() . '/fileadmin/' . $fileImportPathConfiguration2; @@ -72,7 +74,7 @@ public function importsConfiguration(): void $this->getAllRecords('tx_events_domain_model_region'), 'Added or removed unexpected region.' ); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsAllConfigurationTest.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsAllConfiguration.php'); $importedFiles = GeneralUtility::getFilesInDir($this->fileImportPath); self::assertIsArray($importedFiles, 'Failed to retrieve imported files from filesystem.'); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsExampleAsExpectedTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsExampleAsExpectedTest.php index 9f72e772..b2193f17 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsExampleAsExpectedTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsExampleAsExpectedTest.php @@ -1,14 +1,18 @@ setDateAspect(new \DateTimeImmutable('2021-07-13', new \DateTimeZone('Europe/Berlin'))); + $this->setDateAspect(new DateTimeImmutable('2021-07-13', new DateTimeZone('Europe/Berlin'))); $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleImportConfigurationWithCategories.php'); $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleRegion.php'); @@ -62,7 +64,7 @@ public function importsExampleAsExpected(): void $this->getAllRecords('tx_events_domain_model_region'), 'Added or removed unexpected region.' ); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsExampleAsExpected.php'); $importedFiles = GeneralUtility::getFilesInDir($this->fileImportPath); self::assertIsArray($importedFiles, 'Failed to retrieve imported files from filesystem.'); @@ -79,9 +81,7 @@ public function importsExampleAsExpected(): void $this->assertEmptyLog(); } - /** - * @test - */ + #[Test] public function importsSource(): void { $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php'); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsFeaturesTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsFeaturesTest.php index 490c457e..3b8517cd 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsFeaturesTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsFeaturesTest.php @@ -1,18 +1,17 @@ setUpConfiguration([ @@ -24,13 +23,11 @@ public function addsNewFeatures(): void ]); $tester = $this->executeCommand(); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFeaturesAddsNewFeatures.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsFeaturesAddsNewFeatures.php'); $this->assertEmptyLog(); } - /** - * @test - */ + #[Test] public function addsNewFeaturesToExistingOnes(): void { $this->setUpConfiguration([ @@ -43,7 +40,7 @@ public function addsNewFeaturesToExistingOnes(): void ]); $tester = $this->executeCommand(); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFeaturesAddsNewFeatures.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsFeaturesAddsNewFeatures.php'); $this->assertEmptyLog(); } } diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsFirstDateOfDatesTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsFirstDateOfDatesTest.php index 0a6d116a..fa9912d9 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsFirstDateOfDatesTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsFirstDateOfDatesTest.php @@ -1,13 +1,17 @@ importPHPDataSet(__DIR__ . '/Fixtures/Database/FirstDateOfRecurringDatesImportConfiguration.php'); - $this->setDateAspect(new \DateTimeImmutable('2022-07-13', new \DateTimeZone('UTC'))); + $this->setDateAspect(new DateTimeImmutable('2022-07-13', new DateTimeZone('UTC'))); } - /** - * @test - */ + #[Test] public function singelDate(): void { $this->setUpResponses([new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithSingleDate.json') ?: '')]); $this->executeCommand(); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfSingleDate.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsFirstDateOfSingleDate.php'); $this->assertEmptyLog(); } - /** - * @test - */ + #[Test] public function recurringWeekly(): void { $this->setUpResponses([new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithRecurringWeekly.json') ?: '')]); $this->executeCommand(); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesWeekly.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsFirstDateOfRecurringDatesWeekly.php'); $this->assertEmptyLog(); } - /** - * @test - */ + #[Test] public function recurringDaily(): void { $this->setUpResponses([new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithRecurringDaily.json') ?: '')]); $this->executeCommand(); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesDaily.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsFirstDateOfRecurringDatesDaily.php'); $this->assertEmptyLog(); } } diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsSingleConfigurationTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsSingleConfigurationTest.php index 73f912b1..eed27d1d 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsSingleConfigurationTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsSingleConfigurationTest.php @@ -1,21 +1,23 @@ setDateAspect(new \DateTimeImmutable('2021-07-13', new \DateTimeZone('Europe/Berlin'))); + $this->setDateAspect(new DateTimeImmutable('2021-07-13', new DateTimeZone('Europe/Berlin'))); $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleRegion.php'); $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleCategory.php'); @@ -56,7 +58,7 @@ public function importsConfiguration(): void $this->getAllRecords('tx_events_domain_model_region'), 'Added or removed unexpected region.' ); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsExampleAsExpected.php'); $importedFiles = GeneralUtility::getFilesInDir($this->fileImportPath); self::assertIsArray($importedFiles, 'Failed to retrieve imported files from filesystem.'); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsTicketsTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsTicketsTest.php index 4b83a412..a9c30e05 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsTicketsTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsTicketsTest.php @@ -1,20 +1,21 @@ importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php'); @@ -40,7 +41,7 @@ public function importsExampleAsExpected(): void self::assertCount(1, $requests, 'Unexpected number of requests were made.'); self::assertSame('https://example.com/some-path/?experience=beispielstadt&licensekey=example-license&type=Event&mode=next_months%2C12&limit=3&template=ET2014A.json', (string)$requests[0]['request']->getUri()); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsTickets.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsTickets.php'); $this->assertEmptyLog(); } diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsWithConfiguredRepeatUntilTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsWithConfiguredRepeatUntilTest.php index 499c77d0..c9c68807 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsWithConfiguredRepeatUntilTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsWithConfiguredRepeatUntilTest.php @@ -1,25 +1,27 @@ importPHPDataSet(__DIR__ . '/Fixtures/Database/MinimalImportConfiguration.php'); - $this->setDateAspect(new \DateTimeImmutable('2022-07-13', new \DateTimeZone('UTC'))); + $this->setDateAspect(new DateTimeImmutable('2022-07-13', new DateTimeZone('UTC'))); } - /** - * @test - */ + #[Test] public function recurringWeekly(): void { $this->setUpConfiguration([ @@ -31,13 +33,11 @@ public function recurringWeekly(): void $this->executeCommand(); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesWeeklyWithConfiguredRepeatUntil.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsRecurringDatesWeeklyWithConfiguredRepeatUntil.php'); $this->assertEmptyLog(); } - /** - * @test - */ + #[Test] public function recurringDaily(): void { $this->setUpConfiguration([ @@ -49,7 +49,7 @@ public function recurringDaily(): void $this->executeCommand(); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsRecurringDatesDailyWithConfiguredRepeatUntil.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsRecurringDatesDailyWithConfiguredRepeatUntil.php'); $this->assertEmptyLog(); } } diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsWithLocationsTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsWithLocationsTest.php index 10cdcb76..d5754627 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsWithLocationsTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsWithLocationsTest.php @@ -1,13 +1,15 @@ setUpResponses([ @@ -42,9 +42,8 @@ public function importsWithLocations(): void /** * A single location might be available with different ways to write latitude an longitude ("," and "."). * This test ensures this situation is properly handled by streamlining the values. - * - * @test */ + #[Test] public function importsWithSingleLocationOnDuplicates(): void { $this->setUpResponses([ @@ -57,9 +56,7 @@ public function importsWithSingleLocationOnDuplicates(): void $this->assertEmptyLog(); } - /** - * @test - */ + #[Test] public function updatesExistingLocation(): void { $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/ExistingLocation.php'); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutCategoryIfNotProvidedTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutCategoryIfNotProvidedTest.php index bc9efe11..2db6c8b1 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutCategoryIfNotProvidedTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutCategoryIfNotProvidedTest.php @@ -1,18 +1,18 @@ importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php'); @@ -58,7 +58,7 @@ public function importsWithoutCategoryIfNotProvided(): void $this->getAllRecords('sys_category'), 'Added unexpected category.' ); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutCategoryIfNotProvided.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsWithoutCategoryIfNotProvided.php'); $importedFiles = GeneralUtility::getFilesInDir($this->fileImportPath); self::assertIsArray($importedFiles, 'Failed to retrieve imported files from filesystem.'); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutLocationTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutLocationTest.php index 73638bf1..b05d33d7 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutLocationTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutLocationTest.php @@ -1,17 +1,17 @@ importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleImportConfigurationWithoutRegion.php'); @@ -35,7 +35,7 @@ public function importsWithoutLocationIfNotProvided(): void $this->getAllRecords('tx_events_domain_model_location'), 'Added unexpected location.' ); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutLocationIfNotProvided.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsWithoutLocationIfNotProvided.php'); $this->assertEmptyLog(); } } diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutRegionIfNotProvidedTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutRegionIfNotProvidedTest.php index 884df388..0860b338 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutRegionIfNotProvidedTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutRegionIfNotProvidedTest.php @@ -1,18 +1,18 @@ importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleImportConfigurationWithoutRegion.php'); @@ -52,7 +52,7 @@ public function importsWithoutRegionIfNotProvided(): void $this->getAllRecords('tx_events_domain_model_region'), 'Added unexpected region.' ); - $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithoutRegionIfNotProvided.csv'); + $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsWithoutRegionIfNotProvided.php'); $importedFiles = GeneralUtility::getFilesInDir($this->fileImportPath); self::assertIsArray($importedFiles, 'Failed to retrieve imported files from filesystem.'); diff --git a/Tests/Functional/Psr14Events/DestinationDataImport/Assertions/RegisteredEventHandlerCanKeepCustomCategoriesAssigned.php b/Tests/Functional/Psr14Events/DestinationDataImport/Assertions/RegisteredEventHandlerCanKeepCustomCategoriesAssigned.php index 25c71c78..bed803ea 100644 --- a/Tests/Functional/Psr14Events/DestinationDataImport/Assertions/RegisteredEventHandlerCanKeepCustomCategoriesAssigned.php +++ b/Tests/Functional/Psr14Events/DestinationDataImport/Assertions/RegisteredEventHandlerCanKeepCustomCategoriesAssigned.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Psr14Events/DestinationDataImport/Assertions/RegisteredEventHandlerCanModifyEvent.php b/Tests/Functional/Psr14Events/DestinationDataImport/Assertions/RegisteredEventHandlerCanModifyEvent.php index eb9a91c2..3aa74703 100644 --- a/Tests/Functional/Psr14Events/DestinationDataImport/Assertions/RegisteredEventHandlerCanModifyEvent.php +++ b/Tests/Functional/Psr14Events/DestinationDataImport/Assertions/RegisteredEventHandlerCanModifyEvent.php @@ -1,5 +1,7 @@ [ [ @@ -15,14 +17,14 @@ 'uid' => 1, 'pid' => 2, 'event' => 1, - 'start' => 4097728800, + 'start' => 4_097_728_800, 'end' => null, ], [ 'uid' => 2, 'pid' => 2, 'event' => 1, - 'start' => 4097815200, + 'start' => 4_097_815_200, 'end' => null, ], ], diff --git a/Tests/Functional/Psr14Events/DestinationDataImport/CategoriesAssignEventTest.php b/Tests/Functional/Psr14Events/DestinationDataImport/CategoriesAssignEventTest.php index 0d3b1c39..7beea0eb 100644 --- a/Tests/Functional/Psr14Events/DestinationDataImport/CategoriesAssignEventTest.php +++ b/Tests/Functional/Psr14Events/DestinationDataImport/CategoriesAssignEventTest.php @@ -24,9 +24,10 @@ namespace WerkraumMedia\Events\Tests\Functional\Psr14Events\DestinationDataImport; use GuzzleHttp\Psr7\Response; -use WerkraumMedia\Events\Tests\Functional\Import\DestinationDataTest\AbstractTest; +use PHPUnit\Framework\Attributes\Test; +use WerkraumMedia\Events\Tests\Functional\Import\DestinationDataTest\AbstractTestCase; -final class CategoriesAssignEventTest extends AbstractTest +final class CategoriesAssignEventTest extends AbstractTestCase { protected function setUp(): void { @@ -44,9 +45,7 @@ protected function setUp(): void ]); } - /** - * @test - */ + #[Test] public function registeredEventHandlerCanKeepCustomCategoriesAssigned(): void { $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/RegisteredEventHandlerCanKeepCustomCategoriesAssigned.php'); diff --git a/Tests/Functional/Psr14Events/DestinationDataImport/EventImportEventTest.php b/Tests/Functional/Psr14Events/DestinationDataImport/EventImportEventTest.php index fce958a5..cbce5824 100644 --- a/Tests/Functional/Psr14Events/DestinationDataImport/EventImportEventTest.php +++ b/Tests/Functional/Psr14Events/DestinationDataImport/EventImportEventTest.php @@ -24,9 +24,10 @@ namespace WerkraumMedia\Events\Tests\Functional\Psr14Events\DestinationDataImport; use GuzzleHttp\Psr7\Response; -use WerkraumMedia\Events\Tests\Functional\Import\DestinationDataTest\AbstractTest; +use PHPUnit\Framework\Attributes\Test; +use WerkraumMedia\Events\Tests\Functional\Import\DestinationDataTest\AbstractTestCase; -final class EventImportEventTest extends AbstractTest +final class EventImportEventTest extends AbstractTestCase { protected function setUp(): void { @@ -44,9 +45,7 @@ protected function setUp(): void ]); } - /** - * @test - */ + #[Test] public function registeredEventHandlerCanModifyEvent(): void { $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/RegisteredEventHandlerCanModifyEvent.php'); diff --git a/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Database/RegisteredEventHandlerCanKeepCustomCategoriesAssigned.php b/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Database/RegisteredEventHandlerCanKeepCustomCategoriesAssigned.php index f5ac8a8c..e68936d8 100644 --- a/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Database/RegisteredEventHandlerCanKeepCustomCategoriesAssigned.php +++ b/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Database/RegisteredEventHandlerCanKeepCustomCategoriesAssigned.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Database/RegisteredEventHandlerCanModifyEvent.php b/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Database/RegisteredEventHandlerCanModifyEvent.php index 48f7be02..38d9cfd5 100644 --- a/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Database/RegisteredEventHandlerCanModifyEvent.php +++ b/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Database/RegisteredEventHandlerCanModifyEvent.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Extensions/custom_categories/ext_emconf.php b/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Extensions/custom_categories/ext_emconf.php index 3a15f408..0e4784eb 100644 --- a/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Extensions/custom_categories/ext_emconf.php +++ b/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Extensions/custom_categories/ext_emconf.php @@ -1,5 +1,7 @@ 'Custom Categories', 'description' => 'Integrates custom event specifics categories', @@ -7,12 +9,10 @@ 'author' => 'Daniel Siepmann', 'author_email' => 'coding@daniel-siepmann.de', 'state' => 'alpha', - 'createDirs' => '', - 'clearCacheOnLoad' => 0, 'version' => '1.0.0', 'constraints' => [ 'depends' => [ - 'event' => '', + 'events' => '', ], 'conflicts' => [], 'suggests' => [], diff --git a/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Extensions/custom_event/ext_emconf.php b/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Extensions/custom_event/ext_emconf.php index a7b43b28..957e139e 100644 --- a/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Extensions/custom_event/ext_emconf.php +++ b/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Extensions/custom_event/ext_emconf.php @@ -1,5 +1,7 @@ 'Custom Events', 'description' => 'Integrates custom event specifics', @@ -7,12 +9,10 @@ 'author' => 'Daniel Siepmann', 'author_email' => 'coding@daniel-siepmann.de', 'state' => 'alpha', - 'createDirs' => '', - 'clearCacheOnLoad' => 0, 'version' => '1.0.0', 'constraints' => [ 'depends' => [ - 'event' => '', + 'events' => '', ], 'conflicts' => [], 'suggests' => [], diff --git a/Tests/Functional/Updates/Assertions/MigrateDuplicateLocations.php b/Tests/Functional/Updates/Assertions/MigrateDuplicateLocations.php index 376aa02c..53ebbf1f 100644 --- a/Tests/Functional/Updates/Assertions/MigrateDuplicateLocations.php +++ b/Tests/Functional/Updates/Assertions/MigrateDuplicateLocations.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocations.php b/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocations.php index 5c65ab52..be0cdfe7 100644 --- a/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocations.php +++ b/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocations.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocationsNoDuplicates.php b/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocationsNoDuplicates.php index 4b5c399a..132b2592 100644 --- a/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocationsNoDuplicates.php +++ b/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocationsNoDuplicates.php @@ -1,5 +1,7 @@ [ [ diff --git a/Tests/Functional/Updates/MigrateDuplicateLocationsTest.php b/Tests/Functional/Updates/MigrateDuplicateLocationsTest.php index 218d28bc..bf3fee28 100644 --- a/Tests/Functional/Updates/MigrateDuplicateLocationsTest.php +++ b/Tests/Functional/Updates/MigrateDuplicateLocationsTest.php @@ -23,17 +23,15 @@ namespace WerkraumMedia\Events\Tests\Functional\Updates; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; use WerkraumMedia\Events\Tests\Functional\AbstractFunctionalTestCase; use WerkraumMedia\Events\Updates\MigrateDuplicateLocations; -/** - * @testdox The update wizard to migrate duplicate locations - */ +#[TestDox('The update wizard to migrate duplicate locations')] final class MigrateDuplicateLocationsTest extends AbstractFunctionalTestCase { - /** - * @test - */ + #[Test] public function canBeCreated(): void { $subject = $this->get(MigrateDuplicateLocations::class); @@ -41,20 +39,7 @@ public function canBeCreated(): void self::assertInstanceOf(MigrateDuplicateLocations::class, $subject); } - /** - * @test - */ - public function isRegistered(): void - { - self::assertArrayHasKey( - MigrateDuplicateLocations::class, - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'] - ); - } - - /** - * @test - */ + #[Test] public function keepsDataIfNothingToDo(): void { $this->importPHPDataSet(__DIR__ . '/Fixtures/MigrateDuplicateLocationsNoDuplicates.php'); @@ -67,9 +52,7 @@ public function keepsDataIfNothingToDo(): void $this->assertPHPDataSet(__DIR__ . '/Fixtures/MigrateDuplicateLocationsNoDuplicates.php'); } - /** - * @test - */ + #[Test] public function migratesDuplicateEntries(): void { $this->importPHPDataSet(__DIR__ . '/Fixtures/MigrateDuplicateLocations.php'); diff --git a/Tests/ProphecyTrait.php b/Tests/ProphecyTrait.php deleted file mode 100644 index 76dbf040..00000000 --- a/Tests/ProphecyTrait.php +++ /dev/null @@ -1,18 +0,0 @@ -getSorting()); } - /** - * @test - */ + #[Test] public function canBeVisible(): void { $subject = new Category( @@ -61,9 +53,7 @@ public function canBeVisible(): void self::assertFalse($subject->_getProperty('hidden')); } - /** - * @test - */ + #[Test] public function canHide(): void { $subject = new Category( diff --git a/Tests/Unit/Domain/Model/DateTest.php b/Tests/Unit/Domain/Model/DateTest.php index 8ad1cf7d..77214a7c 100644 --- a/Tests/Unit/Domain/Model/DateTest.php +++ b/Tests/Unit/Domain/Model/DateTest.php @@ -1,18 +1,17 @@ setStart(new \DateTime('2022-07-11T13:48:00')); + $subject->setStart(new DateTime('2022-07-11T13:48:00')); self::assertTrue($subject->getHasUsefulStartTime()); } - /** - * @test - */ + #[Test] public function returnsThatItDoesNotHaveUsefulStartTime(): void { $subject = new Date(); - $subject->setStart(new \DateTime('2022-07-11T00:00:00')); + $subject->setStart(new DateTime('2022-07-11T00:00:00')); self::assertFalse($subject->getHasUsefulStartTime()); } - /** - * @test - */ + #[Test] public function returnsThatItHasUsefulEndTime(): void { $subject = new Date(); - $subject->setEnd(new \DateTime('2022-07-11T00:00:00')); + $subject->setEnd(new DateTime('2022-07-11T00:00:00')); self::assertTrue($subject->getHasUsefulEndTime()); } - /** - * @test - */ + #[Test] public function returnsThatItDoesNotHaveUsefulEndTimeWithTime(): void { $subject = new Date(); - $subject->setEnd(new \DateTime('2022-07-11T23:59:00')); + $subject->setEnd(new DateTime('2022-07-11T23:59:00')); self::assertFalse($subject->getHasUsefulEndTime()); } - /** - * @test - */ + #[Test] public function returnsThatItDoesNotHaveUsefulEndTimeWithNull(): void { $subject = new Date(); @@ -78,45 +67,37 @@ public function returnsThatItDoesNotHaveUsefulEndTimeWithNull(): void self::assertFalse($subject->getHasUsefulEndTime()); } - /** - * @test - */ + #[Test] public function returnsThatItEndsOnSameDay(): void { $subject = new Date(); - $subject->setStart(new \DateTime('2022-07-11T14:00:00')); - $subject->setEnd(new \DateTime('2022-07-11T22:00:00')); + $subject->setStart(new DateTime('2022-07-11T14:00:00')); + $subject->setEnd(new DateTime('2022-07-11T22:00:00')); self::assertTrue($subject->getEndsOnSameDay()); } - /** - * @test - */ + #[Test] public function returnsThatItDoesNotEndOnSameDayWithDifferentDates(): void { $subject = new Date(); - $subject->setStart(new \DateTime('2022-07-11T14:00:00')); - $subject->setEnd(new \DateTime('2022-07-13T22:00:00')); + $subject->setStart(new DateTime('2022-07-11T14:00:00')); + $subject->setEnd(new DateTime('2022-07-13T22:00:00')); self::assertFalse($subject->getEndsOnSameDay()); } - /** - * @test - */ + #[Test] public function returnsThatItDoesNotEndOnSameDayWithMissingEnd(): void { $subject = new Date(); - $subject->setStart(new \DateTime('2022-07-11T14:00:00')); + $subject->setStart(new DateTime('2022-07-11T14:00:00')); $subject->setEnd(null); self::assertFalse($subject->getEndsOnSameDay()); } - /** - * @test - */ + #[Test] public function returnsNullAsEnd(): void { $subject = new Date(); @@ -125,12 +106,10 @@ public function returnsNullAsEnd(): void self::assertNull($subject->getEnd()); } - /** - * @test - */ + #[Test] public function returnsEnd(): void { - $end = new \DateTime('2022-07-13T22:00:00'); + $end = new DateTime('2022-07-13T22:00:00'); $subject = new Date(); $subject->setEnd($end); diff --git a/Tests/Unit/Domain/Model/Dto/DateDemandFactoryTest.php b/Tests/Unit/Domain/Model/Dto/DateDemandFactoryTest.php index c0f78190..a02cf6d4 100644 --- a/Tests/Unit/Domain/Model/Dto/DateDemandFactoryTest.php +++ b/Tests/Unit/Domain/Model/Dto/DateDemandFactoryTest.php @@ -23,19 +23,18 @@ namespace WerkraumMedia\Events\Tests\Unit\Domain\Model\Dto; +use DateTimeImmutable; +use Generator; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use TYPO3\CMS\Core\TypoScript\TypoScriptService; use WerkraumMedia\Events\Domain\Model\Dto\DateDemand; use WerkraumMedia\Events\Domain\Model\Dto\DateDemandFactory; -/** - * @covers \WerkraumMedia\Events\Domain\Model\Dto\DateDemandFactory - */ class DateDemandFactoryTest extends TestCase { - /** - * @test - */ + #[Test] public function canBeCreated(): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -50,9 +49,7 @@ public function canBeCreated(): void ); } - /** - * @test - */ + #[Test] public function fromSettingsDoesNotThrowUndefinedArrayKeyWarnings(): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -69,9 +66,7 @@ public function fromSettingsDoesNotThrowUndefinedArrayKeyWarnings(): void ); } - /** - * @test - */ + #[Test] public function searchWordIsSetByRequest(): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -93,9 +88,7 @@ public function searchWordIsSetByRequest(): void ); } - /** - * @test - */ + #[Test] public function synonymsAreSetBySettings(): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -134,9 +127,7 @@ public function synonymsAreSetBySettings(): void ); } - /** - * @test - */ + #[Test] public function categoriesAreSetByRequest(): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -163,9 +154,7 @@ public function categoriesAreSetByRequest(): void ); } - /** - * @test - */ + #[Test] public function featuresAreSetByRequest(): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -192,9 +181,7 @@ public function featuresAreSetByRequest(): void ); } - /** - * @test - */ + #[Test] public function regionIsSetByRequest(): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -222,9 +209,7 @@ public function regionIsSetByRequest(): void ); } - /** - * @test - */ + #[Test] public function regionsAreSetByRequest(): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -255,9 +240,7 @@ public function regionsAreSetByRequest(): void ); } - /** - * @test - */ + #[Test] public function startIsSetByRequest(): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -274,7 +257,7 @@ public function startIsSetByRequest(): void ); self::assertInstanceOf( - \DateTimeImmutable::class, + DateTimeImmutable::class, $result->getStartObject() ); self::assertSame( @@ -287,9 +270,7 @@ public function startIsSetByRequest(): void ); } - /** - * @test - */ + #[Test] public function endIsSetByRequest(): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -306,7 +287,7 @@ public function endIsSetByRequest(): void ); self::assertInstanceOf( - \DateTimeImmutable::class, + DateTimeImmutable::class, $result->getEndObject() ); self::assertSame( @@ -319,11 +300,8 @@ public function endIsSetByRequest(): void ); } - /** - * @test - * - * @dataProvider possibleEndAndStartNullCombinations - */ + #[DataProvider('possibleEndAndStartNullCombinations')] + #[Test] public function returnsEndsOnSameDayIfAnyIsNull( string $start, string $end @@ -347,7 +325,7 @@ public function returnsEndsOnSameDayIfAnyIsNull( ); } - public function possibleEndAndStartNullCombinations(): \Generator + public static function possibleEndAndStartNullCombinations(): Generator { yield 'Both are empty' => [ 'start' => '', @@ -363,9 +341,7 @@ public function possibleEndAndStartNullCombinations(): \Generator ]; } - /** - * @test - */ + #[Test] public function returnsEndsOnSameDayIfBothAreOnSameDay(): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -387,9 +363,7 @@ public function returnsEndsOnSameDayIfBothAreOnSameDay(): void ); } - /** - * @test - */ + #[Test] public function returnsEndsOnSameDayIfBothAreOnDifferentDays(): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -411,14 +385,9 @@ public function returnsEndsOnSameDayIfBothAreOnDifferentDays(): void ); } - /** - * @test - * - * @dataProvider possibleSubmittedHighlights - * - * @param mixed $highlight - */ - public function returnsHighlightIfSet($highlight): void + #[DataProvider('possibleSubmittedHighlights')] + #[Test] + public function returnsHighlightIfSet(mixed $highlight): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -436,21 +405,16 @@ public function returnsHighlightIfSet($highlight): void self::assertTrue($result->getHighlight()); } - public function possibleSubmittedHighlights(): \Generator + public static function possibleSubmittedHighlights(): Generator { yield 'true' => ['highlight' => true]; yield '1 as integer' => ['highlight' => 1]; yield '1 as string' => ['highlight' => '1']; } - /** - * @test - * - * @dataProvider possibleSubmittedFalsyHighlights - * - * @param mixed $highlight - */ - public function returnsNoHighlightIfNotSet($highlight): void + #[DataProvider('possibleSubmittedFalsyHighlights')] + #[Test] + public function returnsNoHighlightIfNotSet(mixed $highlight): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -468,7 +432,7 @@ public function returnsNoHighlightIfNotSet($highlight): void self::assertFalse($result->getHighlight()); } - public function possibleSubmittedFalsyHighlights(): \Generator + public static function possibleSubmittedFalsyHighlights(): Generator { yield 'false' => ['highlight' => false]; yield '0 as integer' => ['highlight' => 0]; @@ -476,9 +440,7 @@ public function possibleSubmittedFalsyHighlights(): \Generator yield 'empty string' => ['highlight' => '']; } - /** - * @test - */ + #[Test] public function returnsOrganizersFromSettings(): void { $typoScriptService = $this->createStub(TypoScriptService::class); @@ -493,9 +455,7 @@ public function returnsOrganizersFromSettings(): void self::assertSame([10, 0, 2], $result->getOrganizers()); } - /** - * @test - */ + #[Test] public function returnsOrganizersFromRequest(): void { $typoScriptService = $this->createStub(TypoScriptService::class); diff --git a/Tests/Unit/Domain/Model/Dto/DateDemandTest.php b/Tests/Unit/Domain/Model/Dto/DateDemandTest.php new file mode 100644 index 00000000..89b8c871 --- /dev/null +++ b/Tests/Unit/Domain/Model/Dto/DateDemandTest.php @@ -0,0 +1,82 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +namespace WerkraumMedia\Events\Tests\Unit\Domain\Model\Dto; + +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\TestCase; +use WerkraumMedia\Events\Domain\Model\Dto\DateDemand; + +final class DateDemandTest extends TestCase +{ + #[Test] + public function canBeCreated(): void + { + $subject = new DateDemand(); + + self::assertInstanceOf( + DateDemand::class, + $subject + ); + } + + #[Test] + #[DataProvider('possibleFeatures')] + public function setsFeatures( + array $incoming, + array $expected + ): void { + $subject = new DateDemand(); + + $subject->setFeatures($incoming); + + self::assertSame($expected, $subject->getFeatures()); + } + + public static function possibleFeatures(): array + { + return [ + 'Empty' => [ + 'incoming'=> [], + 'expected'=> [], + ], + 'Single empty entry' => [ + 'incoming'=> [''], + 'expected'=> [], + ], + 'Single entry' => [ + 'incoming'=> ['10'], + 'expected'=> [10], + ], + 'Two entries' => [ + 'incoming'=> ['10', '20'], + 'expected'=> [10, 20], + ], + 'Two entries, one empty' => [ + 'incoming'=> ['10', ''], + 'expected'=> [10], + ], + ]; + } +} diff --git a/Tests/Unit/Domain/Model/Dto/EventDemandFactoryTest.php b/Tests/Unit/Domain/Model/Dto/EventDemandFactoryTest.php index f656f2ea..bcc4fb3a 100644 --- a/Tests/Unit/Domain/Model/Dto/EventDemandFactoryTest.php +++ b/Tests/Unit/Domain/Model/Dto/EventDemandFactoryTest.php @@ -23,18 +23,14 @@ namespace WerkraumMedia\Events\Tests\Unit\Domain\Model\Dto; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use WerkraumMedia\Events\Domain\Model\Dto\EventDemand; use WerkraumMedia\Events\Domain\Model\Dto\EventDemandFactory; -/** - * @covers \WerkraumMedia\Events\Domain\Model\Dto\EventDemandFactory - */ class EventDemandFactoryTest extends TestCase { - /** - * @test - */ + #[Test] public function canBeCreated(): void { $subject = new EventDemandFactory(); @@ -45,9 +41,7 @@ public function canBeCreated(): void ); } - /** - * @test - */ + #[Test] public function fromSettingsDoesNotThrowUndefinedArrayKeyWarnings(): void { $subject = new EventDemandFactory(); diff --git a/Tests/Unit/Domain/Model/EventTest.php b/Tests/Unit/Domain/Model/EventTest.php index e2551f18..589da438 100644 --- a/Tests/Unit/Domain/Model/EventTest.php +++ b/Tests/Unit/Domain/Model/EventTest.php @@ -4,19 +4,15 @@ namespace WerkraumMedia\Events\Tests\Unit\Domain\Model; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; use WerkraumMedia\Events\Domain\Model\Category; use WerkraumMedia\Events\Domain\Model\Event; -/** - * @covers \WerkraumMedia\Events\Domain\Model\Event - */ class EventTest extends TestCase { - /** - * @test - */ + #[Test] public function canBeCreated(): void { $subject = new Event(); @@ -27,9 +23,7 @@ public function canBeCreated(): void ); } - /** - * @test - */ + #[Test] public function returnsSortedFeatures(): void { $feature1 = $this->createStub(Category::class); @@ -50,9 +44,7 @@ public function returnsSortedFeatures(): void ], $subject->getFeatures()); } - /** - * @test - */ + #[Test] public function returnsEmptyFeaturesStorage(): void { $subject = new Event(); diff --git a/Tests/Unit/Domain/Model/ImportTest.php b/Tests/Unit/Domain/Model/ImportTest.php index 65ebd38d..9becf227 100644 --- a/Tests/Unit/Domain/Model/ImportTest.php +++ b/Tests/Unit/Domain/Model/ImportTest.php @@ -1,30 +1,25 @@ prophesize(Folder::class); + $folder = $this->createStub(Folder::class); $subject = new Import( - $folder->reveal(), + $folder, 0, '' ); @@ -35,15 +30,13 @@ public function canBeCreated(): void ); } - /** - * @test - */ + #[Test] public function returnsRestExperience(): void { - $folder = $this->prophesize(Folder::class); + $folder = $this->createStub(Folder::class); $subject = new Import( - $folder->reveal(), + $folder, 0, 'experience' ); @@ -54,15 +47,13 @@ public function returnsRestExperience(): void ); } - /** - * @test - */ + #[Test] public function returnsStoragePid(): void { - $folder = $this->prophesize(Folder::class); + $folder = $this->createStub(Folder::class); $subject = new Import( - $folder->reveal(), + $folder, 20, '' ); @@ -73,16 +64,14 @@ public function returnsStoragePid(): void ); } - /** - * @test - */ + #[Test] public function returnsRegion(): void { - $folder = $this->prophesize(Folder::class); - $region = $this->prophesize(Region::class); + $folder = $this->createStub(Folder::class); + $region = $this->createStub(Region::class); $subject = new Import( - $folder->reveal(), + $folder, 0, '', '', @@ -90,43 +79,39 @@ public function returnsRegion(): void null, 0, null, - $region->reveal() + $region ); self::assertSame( - $region->reveal(), + $region, $subject->getRegion() ); } - /** - * @test - */ + #[Test] public function returnsFilesFolder(): void { - $folder = $this->prophesize(Folder::class); + $folder = $this->createStub(Folder::class); $subject = new Import( - $folder->reveal(), + $folder, 0, '' ); self::assertSame( - $folder->reveal(), + $folder, $subject->getFilesFolder() ); } - /** - * @test - */ + #[Test] public function returnsCategoriesPid(): void { - $folder = $this->prophesize(Folder::class); + $folder = $this->createStub(Folder::class); $subject = new Import( - $folder->reveal(), + $folder, 0, '', '', @@ -139,38 +124,34 @@ public function returnsCategoriesPid(): void ); } - /** - * @test - */ + #[Test] public function returnsCategoryParent(): void { - $category = $this->prophesize(Category::class); - $folder = $this->prophesize(Folder::class); + $category = $this->createStub(Category::class); + $folder = $this->createStub(Folder::class); $subject = new Import( - $folder->reveal(), + $folder, 0, '', '', 0, - $category->reveal() + $category ); self::assertSame( - $category->reveal(), + $category, $subject->getCategoryParent() ); } - /** - * @test - */ + #[Test] public function returnsFeaturesPid(): void { - $folder = $this->prophesize(Folder::class); + $folder = $this->createStub(Folder::class); $subject = new Import( - $folder->reveal(), + $folder, 0, '', '', @@ -185,40 +166,36 @@ public function returnsFeaturesPid(): void ); } - /** - * @test - */ + #[Test] public function returnsFeaturesParent(): void { - $feature = $this->prophesize(Category::class); - $folder = $this->prophesize(Folder::class); + $feature = $this->createStub(Category::class); + $folder = $this->createStub(Folder::class); $subject = new Import( - $folder->reveal(), + $folder, 0, '', '', 0, null, 0, - $feature->reveal() + $feature ); self::assertSame( - $feature->reveal(), + $feature, $subject->getFeaturesParent() ); } - /** - * @test - */ + #[Test] public function returnsSearchQuery(): void { - $folder = $this->prophesize(Folder::class); + $folder = $this->createStub(Folder::class); $subject = new Import( - $folder->reveal(), + $folder, 0, '', 'name:"Test"' diff --git a/Tests/Unit/Domain/Model/LocationTest.php b/Tests/Unit/Domain/Model/LocationTest.php index ef16da8c..32d7ae64 100644 --- a/Tests/Unit/Domain/Model/LocationTest.php +++ b/Tests/Unit/Domain/Model/LocationTest.php @@ -23,19 +23,15 @@ namespace WerkraumMedia\Events\Tests\Unit\Domain\Model; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use WerkraumMedia\Events\Domain\Model\Location; -/** - * @covers \WerkraumMedia\Events\Domain\Model\Location - */ final class LocationTest extends TestCase { - /** - * @test - * - * @dataProvider possibleLatitudeAndLongitude - */ + #[DataProvider('possibleLatitudeAndLongitude')] + #[Test] public function normalizesLatitudeAndLongitude( string $latitude, string $longitude diff --git a/Tests/Unit/Events/Controller/DateListVariablesTest.php b/Tests/Unit/Events/Controller/DateListVariablesTest.php index ec49ba09..89ccecb5 100644 --- a/Tests/Unit/Events/Controller/DateListVariablesTest.php +++ b/Tests/Unit/Events/Controller/DateListVariablesTest.php @@ -4,30 +4,23 @@ namespace WerkraumMedia\Tests\Unit\Events\Controller; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use TYPO3\CMS\Core\Pagination\PaginationInterface; use TYPO3\CMS\Extbase\Persistence\Generic\QueryResult; use WerkraumMedia\Events\Domain\Model\Dto\DateDemand; use WerkraumMedia\Events\Events\Controller\DateListVariables; -use WerkraumMedia\Events\Tests\ProphecyTrait; -/** - * @covers \WerkraumMedia\Events\Events\Controller\DateListVariables - */ class DateListVariablesTest extends TestCase { - use ProphecyTrait; - - /** - * @test - */ + #[Test] public function canBeCreated(): void { $subject = new DateListVariables( [], new DateDemand(), - $this->prophesize(QueryResult::class)->reveal(), - $this->prophesize(PaginationInterface::class)->reveal() + $this->createStub(QueryResult::class), + $this->createStub(PaginationInterface::class) ); self::assertInstanceOf( @@ -36,9 +29,7 @@ public function canBeCreated(): void ); } - /** - * @test - */ + #[Test] public function returnsInitialSearch(): void { $subject = new DateListVariables( @@ -46,8 +37,8 @@ public function returnsInitialSearch(): void 'executed' => '1', ], new DateDemand(), - $this->prophesize(QueryResult::class)->reveal(), - $this->prophesize(PaginationInterface::class)->reveal() + $this->createStub(QueryResult::class), + $this->createStub(PaginationInterface::class) ); self::assertSame( @@ -58,9 +49,7 @@ public function returnsInitialSearch(): void ); } - /** - * @test - */ + #[Test] public function returnsInitialDemand(): void { $demand = new DateDemand(); @@ -68,8 +57,8 @@ public function returnsInitialDemand(): void [ ], $demand, - $this->prophesize(QueryResult::class)->reveal(), - $this->prophesize(PaginationInterface::class)->reveal() + $this->createStub(QueryResult::class), + $this->createStub(PaginationInterface::class) ); self::assertSame( @@ -78,18 +67,16 @@ public function returnsInitialDemand(): void ); } - /** - * @test - */ + #[Test] public function returnsInitialDates(): void { - $dates = $this->prophesize(QueryResult::class)->reveal(); + $dates = $this->createStub(QueryResult::class); $subject = new DateListVariables( [ ], new DateDemand(), $dates, - $this->prophesize(PaginationInterface::class)->reveal() + $this->createStub(PaginationInterface::class) ); self::assertSame( @@ -98,14 +85,12 @@ public function returnsInitialDates(): void ); } - /** - * @test - */ + #[Test] public function returnsInitialVariablesForView(): void { $demand = new DateDemand(); - $dates = $this->prophesize(QueryResult::class)->reveal(); - $pagination = $this->prophesize(PaginationInterface::class)->reveal(); + $dates = $this->createStub(QueryResult::class); + $pagination = $this->createStub(PaginationInterface::class); $subject = new DateListVariables( [ 'executed' => '1', @@ -128,14 +113,12 @@ public function returnsInitialVariablesForView(): void ); } - /** - * @test - */ + #[Test] public function returnsVariablesForViewWithAddedVariables(): void { $demand = new DateDemand(); - $dates = $this->prophesize(QueryResult::class)->reveal(); - $pagination = $this->prophesize(PaginationInterface::class)->reveal(); + $dates = $this->createStub(QueryResult::class); + $pagination = $this->createStub(PaginationInterface::class); $subject = new DateListVariables( [ 'executed' => '1', @@ -163,14 +146,12 @@ public function returnsVariablesForViewWithAddedVariables(): void ); } - /** - * @test - */ + #[Test] public function returnsVariablesForViewWithOverwrittenVariables(): void { $demand = new DateDemand(); - $dates = $this->prophesize(QueryResult::class)->reveal(); - $pagination = $this->prophesize(PaginationInterface::class)->reveal(); + $dates = $this->createStub(QueryResult::class); + $pagination = $this->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 b375a715..ba2213a4 100644 --- a/Tests/Unit/Events/Controller/DateSearchVariablesTest.php +++ b/Tests/Unit/Events/Controller/DateSearchVariablesTest.php @@ -4,29 +4,22 @@ namespace WerkraumMedia\Events\Tests\Unit\Events\Controller; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use TYPO3\CMS\Extbase\Persistence\Generic\QueryResult; use WerkraumMedia\Events\Domain\Model\Dto\DateDemand; use WerkraumMedia\Events\Events\Controller\DateSearchVariables; -use WerkraumMedia\Events\Tests\ProphecyTrait; -/** - * @covers \WerkraumMedia\Events\Events\Controller\DateSearchVariables - */ class DateSearchVariablesTest extends TestCase { - use ProphecyTrait; - - /** - * @test - */ + #[Test] public function canBeCreated(): void { $subject = new DateSearchVariables( [ ], new DateDemand(), - $this->prophesize(QueryResult::class)->reveal(), + $this->createStub(QueryResult::class), [], [] ); @@ -37,9 +30,7 @@ public function canBeCreated(): void ); } - /** - * @test - */ + #[Test] public function returnsInitializeSearch(): void { $subject = new DateSearchVariables( @@ -47,7 +38,7 @@ public function returnsInitializeSearch(): void 'executed' => '1', ], new DateDemand(), - $this->prophesize(QueryResult::class)->reveal(), + $this->createStub(QueryResult::class), [], [] ); @@ -60,9 +51,7 @@ public function returnsInitializeSearch(): void ); } - /** - * @test - */ + #[Test] public function returnsInitializeDemand(): void { $demand = new DateDemand(); @@ -70,7 +59,7 @@ public function returnsInitializeDemand(): void [ ], $demand, - $this->prophesize(QueryResult::class)->reveal(), + $this->createStub(QueryResult::class), [], [] ); @@ -81,12 +70,10 @@ public function returnsInitializeDemand(): void ); } - /** - * @test - */ + #[Test] public function returnsInitialRegions(): void { - $regions = $this->prophesize(QueryResult::class)->reveal(); + $regions = $this->createStub(QueryResult::class); $subject = new DateSearchVariables( [ ], @@ -102,16 +89,14 @@ public function returnsInitialRegions(): void ); } - /** - * @test - */ + #[Test] public function returnsInitialCategories(): void { $subject = new DateSearchVariables( [ ], new DateDemand(), - $this->prophesize(QueryResult::class)->reveal(), + $this->createStub(QueryResult::class), [ ['example category'], ], @@ -126,16 +111,14 @@ public function returnsInitialCategories(): void ); } - /** - * @test - */ + #[Test] public function returnsInitialFeatures(): void { $subject = new DateSearchVariables( [ ], new DateDemand(), - $this->prophesize(QueryResult::class)->reveal(), + $this->createStub(QueryResult::class), [ ], [ @@ -151,13 +134,11 @@ public function returnsInitialFeatures(): void ); } - /** - * @test - */ + #[Test] public function returnsInitialVariablesForView(): void { $demand = new DateDemand(); - $regions = $this->prophesize(QueryResult::class)->reveal(); + $regions = $this->createStub(QueryResult::class); $subject = new DateSearchVariables( [ 'executed' => '1', @@ -190,13 +171,11 @@ public function returnsInitialVariablesForView(): void ); } - /** - * @test - */ + #[Test] public function returnsVariablesForViewWithAddedVariables(): void { $demand = new DateDemand(); - $regions = $this->prophesize(QueryResult::class)->reveal(); + $regions = $this->createStub(QueryResult::class); $subject = new DateSearchVariables( [ 'executed' => '1', @@ -234,13 +213,11 @@ public function returnsVariablesForViewWithAddedVariables(): void ); } - /** - * @test - */ + #[Test] public function returnsVariablesForViewWithOverwrittenVariables(): void { $demand = new DateDemand(); - $regions = $this->prophesize(QueryResult::class)->reveal(); + $regions = $this->createStub(QueryResult::class); $subject = new DateSearchVariables( [ 'executed' => '1', diff --git a/Tests/Unit/Service/DestinationDataImportService/DatesFactoryTest.php b/Tests/Unit/Service/DestinationDataImportService/DatesFactoryTest.php index f2998a05..561cd42b 100644 --- a/Tests/Unit/Service/DestinationDataImportService/DatesFactoryTest.php +++ b/Tests/Unit/Service/DestinationDataImportService/DatesFactoryTest.php @@ -4,6 +4,10 @@ namespace WerkraumMedia\Events\Tests\Unit\Service\DestinationDataImportService; +use DateTimeImmutable; +use Generator; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Context\DateTimeAspect; @@ -13,9 +17,6 @@ use WerkraumMedia\Events\Domain\Model\Date; use WerkraumMedia\Events\Service\DestinationDataImportService\DatesFactory; -/** - * @covers \WerkraumMedia\Events\Service\DestinationDataImportService\DatesFactory - */ class DatesFactoryTest extends TestCase { private function createTestSubject( @@ -26,14 +27,13 @@ private function createTestSubject( $logManager->method('getLogger')->willReturn($logger); return new DatesFactory( - $this->createContext(new \DateTimeImmutable($contextDate)), + $this->createContext(new DateTimeImmutable($contextDate)), $this->createStub(ConfigurationManager::class), $logManager ); } - /** - * @test - */ + + #[Test] public function canBeCreated(): void { $subject = $this->createTestSubject('now'); @@ -44,22 +44,19 @@ public function canBeCreated(): void ); } - /** - * @test - * - * @dataProvider possibleUnkownInput - */ + #[DataProvider('possibleUnkownInput')] + #[Test] public function returnsNoResultOnUnkownInput(array $unkownInput): void { $subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin'); $result = $subject->createDates($unkownInput, false); - self::assertInstanceOf(\Generator::class, $result); + self::assertInstanceOf(Generator::class, $result); self::assertCount(0, iterator_to_array($result)); } - public function possibleUnkownInput(): array + public static function possibleUnkownInput(): array { return [ 'Empty Intervals' => [ @@ -74,9 +71,7 @@ public function possibleUnkownInput(): array ]; } - /** - * @test - */ + #[Test] public function returnsSingleNotCanceledDate(): void { $subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin'); @@ -88,7 +83,7 @@ public function returnsSingleNotCanceledDate(): void 'interval' => 1, ]], false); - self::assertInstanceOf(\Generator::class, $result); + self::assertInstanceOf(Generator::class, $result); $firstEntry = $result->current(); @@ -100,9 +95,7 @@ public function returnsSingleNotCanceledDate(): void self::assertSame('no', $firstEntry->getCanceled()); } - /** - * @test - */ + #[Test] public function returnsWeeklyWithConfiguredRepeat(): void { $subject = $this->createTestSubject('2023-01-01T13:17:24 Europe/Berlin'); @@ -119,15 +112,13 @@ public function returnsWeeklyWithConfiguredRepeat(): void 'interval' => 1, ]], false); - self::assertInstanceOf(\Generator::class, $result); + self::assertInstanceOf(Generator::class, $result); $result = iterator_to_array($result); self::assertCount(16, $result); } - /** - * @test - */ + #[Test] public function returnsSingleCanceledDate(): void { $subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin'); @@ -139,7 +130,7 @@ public function returnsSingleCanceledDate(): void 'interval' => 1, ]], true); - self::assertInstanceOf(\Generator::class, $result); + self::assertInstanceOf(Generator::class, $result); $firstEntry = $result->current(); @@ -151,9 +142,7 @@ public function returnsSingleCanceledDate(): void self::assertSame('canceled', $firstEntry->getCanceled()); } - /** - * @test - */ + #[Test] public function returnsCanceledDatesOnDailyBasis(): void { $subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin'); @@ -167,7 +156,7 @@ public function returnsCanceledDatesOnDailyBasis(): void 'interval' => 1, ]], true); - self::assertInstanceOf(\Generator::class, $result); + self::assertInstanceOf(Generator::class, $result); $result = iterator_to_array($result); self::assertCount(5, $result); @@ -182,9 +171,7 @@ public function returnsCanceledDatesOnDailyBasis(): void self::assertSame('canceled', $result[4]->getCanceled()); } - /** - * @test - */ + #[Test] public function returnsNotCanceledDatesOnDailyBasis(): void { $subject = $this->createTestSubject('2022-08-29T13:17:24 Europe/Berlin'); @@ -198,7 +185,7 @@ public function returnsNotCanceledDatesOnDailyBasis(): void 'interval' => 1, ]], false); - self::assertInstanceOf(\Generator::class, $result); + self::assertInstanceOf(Generator::class, $result); $result = iterator_to_array($result); self::assertCount(5, $result); @@ -213,9 +200,7 @@ public function returnsNotCanceledDatesOnDailyBasis(): void self::assertSame('no', $result[4]->getCanceled()); } - /** - * @test - */ + #[Test] public function returnsCanceledDatesOnWeeklyBasis(): void { $subject = $this->createTestSubject('2022-08-29T13:17:24 Europe/Berlin'); @@ -233,7 +218,7 @@ public function returnsCanceledDatesOnWeeklyBasis(): void 'interval' => 1, ]], true); - self::assertInstanceOf(\Generator::class, $result); + self::assertInstanceOf(Generator::class, $result); $result = iterator_to_array($result); self::assertCount(4, $result); @@ -256,9 +241,7 @@ public function returnsCanceledDatesOnWeeklyBasis(): void self::assertSame('canceled', $result[3]->getCanceled()); } - /** - * @test - */ + #[Test] public function returnsNotCanceledDatesOnWeeklyBasis(): void { $subject = $this->createTestSubject('2022-08-29T13:17:24 Europe/Berlin'); @@ -276,7 +259,7 @@ public function returnsNotCanceledDatesOnWeeklyBasis(): void 'interval' => 1, ]], false); - self::assertInstanceOf(\Generator::class, $result); + self::assertInstanceOf(Generator::class, $result); $result = iterator_to_array($result); self::assertCount(4, $result); @@ -299,9 +282,7 @@ public function returnsNotCanceledDatesOnWeeklyBasis(): void self::assertSame('no', $result[3]->getCanceled()); } - /** - * @test - */ + #[Test] public function returnsCanceledDatesOnMixedIntervals(): void { $subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin'); @@ -335,7 +316,7 @@ public function returnsCanceledDatesOnMixedIntervals(): void ], ], true); - self::assertInstanceOf(\Generator::class, $result); + self::assertInstanceOf(Generator::class, $result); $result = iterator_to_array($result); self::assertCount(8, $result); @@ -346,9 +327,7 @@ public function returnsCanceledDatesOnMixedIntervals(): void } } - /** - * @test - */ + #[Test] public function returnsNotCanceledDatesOnMixedIntervals(): void { $subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin'); @@ -382,7 +361,7 @@ public function returnsNotCanceledDatesOnMixedIntervals(): void ], ], false); - self::assertInstanceOf(\Generator::class, $result); + self::assertInstanceOf(Generator::class, $result); $result = iterator_to_array($result); self::assertCount(8, $result); @@ -393,7 +372,7 @@ public function returnsNotCanceledDatesOnMixedIntervals(): void } } - private function createContext(\DateTimeImmutable $dateTime): Context + private function createContext(DateTimeImmutable $dateTime): Context { $context = new Context(); $context->setAspect('date', new DateTimeAspect($dateTime)); diff --git a/Tests/Unit/Service/DestinationDataImportService/LocationAssignmentTest.php b/Tests/Unit/Service/DestinationDataImportService/LocationAssignmentTest.php index a2faff0b..7dae8abb 100644 --- a/Tests/Unit/Service/DestinationDataImportService/LocationAssignmentTest.php +++ b/Tests/Unit/Service/DestinationDataImportService/LocationAssignmentTest.php @@ -23,19 +23,23 @@ namespace WerkraumMedia\Events\Tests\Unit\Service\DestinationDataImportService; +use DG\BypassFinals; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use WerkraumMedia\Events\Domain\Model\Location; use WerkraumMedia\Events\Domain\Repository\LocationRepository; use WerkraumMedia\Events\Service\DestinationDataImportService\LocationAssignment; -/** - * @covers \WerkraumMedia\Events\Service\DestinationDataImportService\LocationAssignment - */ final class LocationAssignmentTest extends TestCase { - /** - * @test - */ + protected function setUp(): void + { + BypassFinals::enable(); + parent::setUp(); + } + + #[Test] public function canBeCreated(): void { $repository = $this->createStub(LocationRepository::class); @@ -50,13 +54,11 @@ public function canBeCreated(): void } /** - * @test - * - * @dataProvider possibleLatitudeAndLongitude - * * @param string|float $latitude * @param string|float $longitude */ + #[DataProvider('possibleLatitudeAndLongitude')] + #[Test] public function normalizesLatitudeAndLongitude( $latitude, $longitude diff --git a/Tests/Unit/Service/DestinationDataImportService/UrlFactoryTest.php b/Tests/Unit/Service/DestinationDataImportService/UrlFactoryTest.php index d75eac74..8b9e678b 100644 --- a/Tests/Unit/Service/DestinationDataImportService/UrlFactoryTest.php +++ b/Tests/Unit/Service/DestinationDataImportService/UrlFactoryTest.php @@ -1,36 +1,27 @@ prophesize(ConfigurationManager::class); - $configurationManager->getConfiguration( - ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, - 'Events', - 'Pi1' - )->willReturn([]); + $configurationManager = $this->createStub(BackendConfigurationManager::class); + $configurationManager->method('getConfiguration')->willReturn([]); $subject = new UrlFactory( - $configurationManager->reveal() + $configurationManager ); self::assertInstanceOf( @@ -39,28 +30,21 @@ public function canBeCreated(): void ); } - /** - * @test - * - * @dataProvider possibleImports - */ + #[DataProvider('possibleImports')] + #[Test] public function createSearchResultUrl( - ObjectProphecy $import, + Stub $import, array $settings, string $expectedResult ): void { - $configurationManager = $this->prophesize(ConfigurationManager::class); - $configurationManager->getConfiguration( - ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, - 'Events', - 'Pi1' - )->willReturn(['destinationData' => $settings]); + $configurationManager = $this->createStub(BackendConfigurationManager::class); + $configurationManager->method('getConfiguration')->willReturn(['settings' => ['destinationData' => $settings]]); $subject = new UrlFactory( - $configurationManager->reveal() + $configurationManager ); - $result = $subject->createSearchResultUrl($import->reveal()); + $result = $subject->createSearchResultUrl($import); self::assertSame( $result, @@ -68,14 +52,14 @@ public function createSearchResultUrl( ); } - public function possibleImports(): array + public static function possibleImports(): array { return [ 'All provided' => [ 'import' => (function () { - $import = $this->prophesize(Import::class); - $import->getRestExperience()->willReturn('experience'); - $import->getSearchQuery()->willReturn(''); + $import = self::createStub(Import::class); + $import->method('getRestExperience')->willReturn('experience'); + $import->method('getSearchQuery')->willReturn(''); return $import; })(), @@ -91,9 +75,9 @@ public function possibleImports(): array ], 'All missing' => [ 'import' => (function () { - $import = $this->prophesize(Import::class); - $import->getRestExperience()->willReturn(''); - $import->getSearchQuery()->willReturn(''); + $import = self::createStub(Import::class); + $import->method('getRestExperience')->willReturn(''); + $import->method('getSearchQuery')->willReturn(''); return $import; })(), @@ -104,9 +88,9 @@ public function possibleImports(): array ], 'Some missing' => [ 'import' => (function () { - $import = $this->prophesize(Import::class); - $import->getRestExperience()->willReturn('experience'); - $import->getSearchQuery()->willReturn(''); + $import = self::createStub(Import::class); + $import->method('getRestExperience')->willReturn('experience'); + $import->method('getSearchQuery')->willReturn(''); return $import; })(), @@ -120,9 +104,9 @@ public function possibleImports(): array ], 'With search query' => [ 'import' => (function () { - $import = $this->prophesize(Import::class); - $import->getRestExperience()->willReturn('experience'); - $import->getSearchQuery()->willReturn('name:"Test Something"'); + $import = self::createStub(Import::class); + $import->method('getRestExperience')->willReturn('experience'); + $import->method('getSearchQuery')->willReturn('name:"Test Something"'); return $import; })(), diff --git a/composer.json b/composer.json index e76906ff..08247665 100644 --- a/composer.json +++ b/composer.json @@ -19,13 +19,13 @@ } ], "require": { - "php": "~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0", - "typo3/cms-core": "^10.4 || ^11.5", - "typo3/cms-extbase": "^10.4 || ^11.5", - "typo3/cms-filelist": "^10.4 || ^11.5", - "typo3/cms-filemetadata": "^10.4 || ^11.5", - "typo3/cms-fluid": "^10.4 || ^11.5", - "typo3/cms-frontend": "^10.4 || ^11.5" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "typo3/cms-core": "^12.4", + "typo3/cms-extbase": "^12.4", + "typo3/cms-filelist": "^12.4", + "typo3/cms-filemetadata": "^12.4", + "typo3/cms-fluid": "^12.4", + "typo3/cms-frontend": "^12.4" }, "autoload": { "psr-4": { @@ -46,33 +46,39 @@ ] }, "extra": { + "composer-exit-on-patch-failure": true, + "patches": { + "typo3/testing-framework": { + "Fix TypoScript record creation": "Patches/testing-framework-ts-record.patch", + "Fix Request state": "Patches/testing-framework-request-state.patch" + } + }, "typo3/cms": { - "cms-package-dir": "{$vendor-dir}/typo3/cms", "extension-key": "events", "web-dir": ".Build/web" } }, "require-dev": { - "codappix/typo3-php-datasets": "^1.2", - "friendsofphp/php-cs-fixer": "^3.4", + "codappix/typo3-php-datasets": "^1.4", + "cweagans/composer-patches": "^1.7", + "dg/bypass-finals": "^1.5", + "friendsofphp/php-cs-fixer": "^3.38", "guzzlehttp/guzzle": "^6.3 || ^7.3", - "jangregor/phpstan-prophecy": "1.0.0", - "phpspec/prophecy-phpunit": "^1.0 || ^2.0", "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "1.10.28", - "phpstan/phpstan-phpunit": "1.1.1", - "saschaegerer/phpstan-typo3": "1.1.2", - "squizlabs/php_codesniffer": "^3.5", - "typo3/cms-backend": "^10.4 || ^11.5", - "typo3/cms-fluid-styled-content": "^10.4 || ^11.5", - "typo3/testing-framework": "^6.14" + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-phpunit": "1.3.15", + "saschaegerer/phpstan-typo3": "1.9.0", + "typo3/cms-backend": "^12.4", + "typo3/cms-fluid-styled-content": "^12.4", + "typo3/testing-framework": "^8.0" }, "config": { "sort-packages": true, "allow-plugins": { "typo3/class-alias-loader": true, "typo3/cms-composer-installers": true, - "phpstan/extension-installer": true + "phpstan/extension-installer": true, + "cweagans/composer-patches": true } } } diff --git a/ext_emconf.php b/ext_emconf.php index 3379a7de..606cff6a 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -1,5 +1,7 @@ 'Events', 'description' => 'Extension to manage events', @@ -7,12 +9,10 @@ 'author' => 'Dirk Koritnik, Daniel Siepmann', 'author_email' => 'koritnik@werkraum-media.de, coding@daniel-siepmann.de', 'state' => 'stable', - 'createDirs' => '', - 'clearCacheOnLoad' => 0, 'version' => '4.0.0', 'constraints' => [ 'depends' => [ - 'typo3' => '10.4.00-11.5.99', + 'typo3' => '', ], 'conflicts' => [], 'suggests' => [], diff --git a/ext_localconf.php b/ext_localconf.php index 49fe893d..3f4aa83a 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,33 +1,42 @@ 'search'], - [\WerkraumMedia\Events\Controller\DateController::class => 'search'] + [DateController::class => 'search'], + [DateController::class => 'search'] ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + ExtensionUtility::configurePlugin( 'Events', 'DateList', - [\WerkraumMedia\Events\Controller\DateController::class => 'list'], - [\WerkraumMedia\Events\Controller\DateController::class => 'list'] + [DateController::class => 'list'], + [DateController::class => 'list'] ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + ExtensionUtility::configurePlugin( 'Events', 'DateShow', - [\WerkraumMedia\Events\Controller\DateController::class => 'show'], - [\WerkraumMedia\Events\Controller\DateController::class => 'show'] + [DateController::class => 'show'], + [DateController::class => 'show'] ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + ExtensionUtility::configurePlugin( 'Events', 'Selected', - [\WerkraumMedia\Events\Controller\EventController::class => 'list'] + [EventController::class => 'list'] ); if ( @@ -39,19 +48,15 @@ $GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = '^events_search'; - $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); + $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class); $iconRegistry->registerIcon( 'events-plugin', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + SvgIconProvider::class, ['source' => 'EXT:events/Resources/Public/Icons/Extension.svg'] ); $iconRegistry->registerIcon( 'pages-module-events', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + SvgIconProvider::class, ['source' => 'EXT:events/Resources/Public/Icons/Folder.svg'] ); - - \WerkraumMedia\Events\Caching\PageCacheTimeout::register(); - \WerkraumMedia\Events\Updates\MigrateOldLocations::register(); - \WerkraumMedia\Events\Updates\MigrateDuplicateLocations::register(); }); diff --git a/ext_tables.php b/ext_tables.php deleted file mode 100644 index ac01726f..00000000 --- a/ext_tables.php +++ /dev/null @@ -1,19 +0,0 @@ -\\|null\\) does not accept int\\.$#" count: 1 path: Classes/Domain/Model/Category.php - - message: "#^Parameter \\#1 \\$categories of method WerkraumMedia\\\\Events\\\\Domain\\\\Model\\\\Event\\:\\:setCategories\\(\\) expects TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage\\, TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage\\ given\\.$#" + message: "#^Method WerkraumMedia\\\\Events\\\\Domain\\\\Model\\\\Date\\:\\:getLanguageUid\\(\\) should return int but returns int\\<\\-1, max\\>\\|null\\.$#" count: 1 - path: Classes/Service/DestinationDataImportService.php + path: Classes/Domain/Model/Date.php - - message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(mixed\\)\\: mixed\\)\\|null, 'strval' given\\.$#" + message: "#^Property TYPO3\\\\CMS\\\\Extbase\\\\DomainObject\\\\AbstractDomainObject\\:\\:\\$_languageUid \\(int\\<\\-1, max\\>\\|null\\) does not accept int\\.$#" count: 1 - path: Classes/Domain/DestinationData/ImportFactory.php + path: Classes/Domain/Model/Date.php - - message: "#^Parameter \\#2 \\$array of function array_map expects array, mixed given\\.$#" + message: "#^Method WerkraumMedia\\\\Events\\\\Domain\\\\Model\\\\Event\\:\\:getLanguageUid\\(\\) should return int but returns int\\<\\-1, max\\>\\|null\\.$#" count: 1 - path: Classes/Domain/DestinationData/ImportFactory.php + path: Classes/Domain/Model/Event.php - - message: "#^Parameter \\#2 \\$callback of function usort expects callable\\(TEntity, TEntity\\)\\: int, Closure\\(WerkraumMedia\\\\Events\\\\Domain\\\\Model\\\\Category, WerkraumMedia\\\\Events\\\\Domain\\\\Model\\\\Category\\)\\: int\\<\\-1, 1\\> given\\.$#" - count: 2 + message: "#^Method WerkraumMedia\\\\Events\\\\Domain\\\\Model\\\\Event\\:\\:getLocalizedUid\\(\\) should return int but returns int\\<0, max\\>\\|null\\.$#" + count: 1 path: Classes/Domain/Model/Event.php - - message: "#^Method WerkraumMedia\\\\Events\\\\Domain\\\\Model\\\\Event\\:\\:getCategories\\(\\) should return array\\ but returns array\\\\.$#" + message: "#^Parameter \\#2 \\$callback of function usort expects callable\\(mixed, mixed\\)\\: int, Closure\\(WerkraumMedia\\\\Events\\\\Domain\\\\Model\\\\Category, WerkraumMedia\\\\Events\\\\Domain\\\\Model\\\\Category\\)\\: int\\<\\-1, 1\\> given\\.$#" count: 1 path: Classes/Domain/Model/Event.php - - message: "#^Method WerkraumMedia\\\\Events\\\\Domain\\\\Model\\\\Event\\:\\:getFeatures\\(\\) should return array\\ but returns array\\\\.$#" + message: "#^Property TYPO3\\\\CMS\\\\Extbase\\\\DomainObject\\\\AbstractDomainObject\\:\\:\\$_languageUid \\(int\\<\\-1, max\\>\\|null\\) does not accept int\\.$#" count: 1 path: Classes/Domain/Model/Event.php - - message: "#^Call to method deleteFile\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Resource\\\\Storage\\.$#" + message: "#^Property TYPO3\\\\CMS\\\\Extbase\\\\DomainObject\\\\AbstractDomainObject\\:\\:\\$_languageUid \\(int\\<\\-1, max\\>\\|null\\) does not accept int\\.$#" count: 1 - path: Classes/Service/Cleanup/Files.php + path: Classes/Domain/Model/Location.php - - message: "#^Call to method getFile\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Resource\\\\Storage\\.$#" + message: "#^Method WerkraumMedia\\\\Events\\\\Domain\\\\Model\\\\Organizer\\:\\:getLanguageUid\\(\\) should return int but returns int\\<\\-1, max\\>\\|null\\.$#" count: 1 - path: Classes/Service/Cleanup/Files.php + path: Classes/Domain/Model/Organizer.php - - message: "#^Call to method hasFile\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Resource\\\\Storage\\.$#" + message: "#^Property TYPO3\\\\CMS\\\\Extbase\\\\DomainObject\\\\AbstractDomainObject\\:\\:\\$_languageUid \\(int\\<\\-1, max\\>\\|null\\) does not accept int\\.$#" count: 1 - path: Classes/Service/Cleanup/Files.php + path: Classes/Domain/Model/Organizer.php - - message: "#^Argument of an invalid type Doctrine\\\\DBAL\\\\Result\\|int supplied for foreach, only iterables are supported\\.$#" + message: "#^Method WerkraumMedia\\\\Events\\\\Domain\\\\Model\\\\Region\\:\\:getLanguageUid\\(\\) should return int but returns int\\<\\-1, max\\>\\|null\\.$#" count: 1 - path: Classes/Service/Cleanup/Files.php + path: Classes/Domain/Model/Region.php - - message: "#^Argument of an invalid type Doctrine\\\\DBAL\\\\Driver\\\\ResultStatement\\|int supplied for foreach, only iterables are supported\\.$#" + message: "#^Property TYPO3\\\\CMS\\\\Extbase\\\\DomainObject\\\\AbstractDomainObject\\:\\:\\$_languageUid \\(int\\<\\-1, max\\>\\|null\\) does not accept int\\.$#" count: 1 - path: Classes/Service/Cleanup/Files.php + path: Classes/Domain/Model/Region.php - - message: "#^Cannot call method fetchAllAssociativeIndexed\\(\\) on Doctrine\\\\DBAL\\\\Result\\|int\\.$#" + message: "#^Method WerkraumMedia\\\\Events\\\\Domain\\\\Repository\\\\LocationRepository\\:\\:findOneByGlobalId\\(\\) should return WerkraumMedia\\\\Events\\\\Domain\\\\Model\\\\Location\\|null but returns \\(T of object\\)\\|null\\.$#" count: 1 - path: Classes/Service/Cleanup/Files.php + path: Classes/Domain/Repository/LocationRepository.php - - message: "#^Method WerkraumMedia\\\\Events\\\\Service\\\\Cleanup\\\\Files\\:\\:getPotentialFilesToDelete\\(\\) should return array\\ but returns array\\\\>\\.$#" + message: "#^Cannot cast mixed to int\\.$#" count: 1 path: Classes/Service/Cleanup/Files.php - - message: "#^Parameter \\#1 \\$uid of class WerkraumMedia\\\\Events\\\\Service\\\\DestinationDataImportService\\\\DataHandler\\\\Assignment constructor expects int, int\\|null given\\.$#" - count: 2 - path: Classes/Service/DestinationDataImportService.php + message: "#^Cannot cast mixed to string\\.$#" + count: 1 + path: Classes/Service/Cleanup/Files.php - - message: "#^Parameter \\#3 \\$assignments of class WerkraumMedia\\\\Events\\\\Service\\\\DestinationDataImportService\\\\DataHandler\\\\Assignment constructor expects array\\, array\\ given\\.$#" - count: 2 - path: Classes/Service/DestinationDataImportService.php + message: "#^Method WerkraumMedia\\\\Events\\\\Service\\\\Cleanup\\\\Files\\:\\:getPotentialFilesToDelete\\(\\) should return array\\ but returns array\\\\>\\.$#" + count: 1 + path: Classes/Service/Cleanup/Files.php - message: "#^Method WerkraumMedia\\\\Events\\\\Service\\\\DestinationDataImportService\\\\CategoriesAssignment\\:\\:getCategories\\(\\) should return TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage\\ but returns TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage\\\\.$#" count: 2 path: Classes/Service/DestinationDataImportService/CategoriesAssignment.php - - - message: "#^Argument of an invalid type Doctrine\\\\DBAL\\\\Driver\\\\ResultStatement\\|int supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: Classes/Updates/MigrateOldLocations.php - - - - message: "#^Cannot call method fetchAssociative\\(\\) on Doctrine\\\\DBAL\\\\Driver\\\\ResultStatement\\|int\\.$#" - count: 1 - path: Classes/Updates/MigrateOldLocations.php - - message: "#^Method WerkraumMedia\\\\Events\\\\Service\\\\DestinationDataImportService\\\\FilesAssignment\\:\\:getImages\\(\\) should return TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage\\ but returns TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage\\\\.$#" count: 1 path: Classes/Service/DestinationDataImportService/FilesAssignment.php - - - message: "#^Cannot call method fetchAllAssociativeIndexed\\(\\) on Doctrine\\\\DBAL\\\\Driver\\\\ResultStatement\\|int\\.$#" - count: 1 - path: Classes/Service/Cleanup/Files.php - - - - message: "#^Argument of an invalid type Doctrine\\\\DBAL\\\\Result\\|int supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: Classes/Updates/MigrateOldLocations.php - - - - message: "#^Cannot call method fetchAssociative\\(\\) on Doctrine\\\\DBAL\\\\Result\\|int\\.$#" - count: 1 - path: Classes/Updates/MigrateOldLocations.php - - message: "#^Method WerkraumMedia\\\\Events\\\\Updates\\\\MigrateOldLocations\\:\\:getExitingLocationUid\\(\\) should return int but returns mixed\\.$#" count: 1 path: Classes/Updates/MigrateOldLocations.php - - - - message: "#^Offset 'sys_language_uid' does not exist on array\\{location\\: int\\}\\.$#" - count: 1 - path: Classes/Updates/MigrateOldLocations.php - - - - message: "#^Offset 'uid' does not exist on array\\{location\\: int\\}\\.$#" - count: 1 - path: Classes/Updates/MigrateOldLocations.php - - - - - message: "#^Cannot call method getEnd\\(\\) on mixed\\.$#" - count: 1 - path: Classes/Caching/PageCacheTimeout.php diff --git a/phpstan.neon b/phpstan.neon index 186b4902..b0c6ded9 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -7,19 +7,4 @@ parameters: - Configuration checkMissingIterableValueType: false checkGenericClassInNonGenericObjectType: false - reportUnmatchedIgnoredErrors: false - ignoreErrors: - - "#^Call to an undefined method Doctrine\\\\DBAL\\\\Result\\:\\:fetch\\(\\)\\.$#" - - "#^Cannot call method fetchAll\\(\\) on Doctrine\\\\DBAL\\\\Driver\\\\ResultStatement\\|int\\.$#" - - "#^Cannot call method fetchAll\\(\\) on Doctrine\\\\DBAL\\\\Result\\|int\\.$#" - - "#^Cannot call method fetchAllAssociative\\(\\) on Doctrine\\\\DBAL\\\\Driver\\\\ResultStatement\\|int\\.$#" - - "#^Cannot call method fetchAllAssociative\\(\\) on Doctrine\\\\DBAL\\\\Result\\|int\\.$#" - - "#^Cannot call method fetchColumn\\(\\) on Doctrine\\\\DBAL\\\\Driver\\\\ResultStatement\\|int\\.$#" - - "#^Cannot call method fetchColumn\\(\\) on Doctrine\\\\DBAL\\\\Result\\|int\\.$#" - - "#^Cannot call method fetchFirstColumn\\(\\) on Doctrine\\\\DBAL\\\\Driver\\\\ResultStatement\\|int\\.$#" - - "#^Cannot call method fetchFirstColumn\\(\\) on Doctrine\\\\DBAL\\\\Result\\|int\\.$#" - - "#^Cannot call method fetch\\(\\) on Doctrine\\\\DBAL\\\\Driver\\\\ResultStatement\\|int\\.$#" - - "#^Cannot call method fetch\\(\\) on Doctrine\\\\DBAL\\\\Result\\|int\\.$#" - - "#^Cannot call method fetchOne\\(\\) on Doctrine\\\\DBAL\\\\Driver\\\\ResultStatement\\|int\\.$#" - - "#^Cannot call method fetchOne\\(\\) on Doctrine\\\\DBAL\\\\Result\\|int\\.$#" - - "#^Parameter \\#1 \\.\\.\\.\\$predicates of method TYPO3\\\\CMS\\\\Core\\\\Database\\\\Query\\\\QueryBuilder\\:\\:where\\(\\) expects array\\\\|Doctrine\\\\DBAL\\\\Query\\\\Expression\\\\CompositeExpression, string given\\.$#" + reportUnmatchedIgnoredErrors: true diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5f254386..455ab29c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,22 +1,19 @@ - + cacheDirectory=".phpunit.cache" + backupStaticProperties="false" + requireCoverageMetadata="false" +> Tests/Unit/ @@ -26,14 +23,16 @@ - - - Classes - - + - + + + + + Classes + + diff --git a/shell.nix b/shell.nix index 90b74d5b..9ebd4666 100644 --- a/shell.nix +++ b/shell.nix @@ -23,7 +23,7 @@ let ]; text = '' rm -rf vendor/ composer.lock .Build/ - composer update --prefer-dist --no-progress --working-dir="$PROJECT_ROOT" + composer update --prefer-dist --no-progress ''; }; @@ -115,7 +115,7 @@ let }; in pkgs.mkShell { - name = "TYPO3 Extension Watchlist"; + name = "TYPO3 Extension Events"; buildInputs = [ projectInstall projectValidateComposer @@ -130,8 +130,6 @@ in pkgs.mkShell { ]; shellHook = '' - export PROJECT_ROOT="$(pwd)" - export typo3DatabaseDriver=pdo_sqlite ''; }