diff --git a/Classes/Command/DestinationDataImportCommand.php b/Classes/Command/DestinationDataImportCommand.php deleted file mode 100644 index b045e76..0000000 --- a/Classes/Command/DestinationDataImportCommand.php +++ /dev/null @@ -1,97 +0,0 @@ -destinationDataImportService = $destinationDataImportService; - $this->importFactory = $importFactory; - } - - public function configure(): void - { - $this->setDescription('Import Destination Data Events'); - $this->setHelp('Destination Data Events are imported'); - - $this->addArgument( - 'storage-pid', - InputArgument::REQUIRED, - 'What is the storage pid?' - ); - $this->addArgument( - 'rest-experience', - InputArgument::REQUIRED, - 'What is the rest experience?' - ); - $this->addArgument( - 'files-folder', - InputArgument::REQUIRED, - 'Where to save the image files?' - ); - $this->addArgument( - 'region-uid', - InputArgument::OPTIONAL, - 'What is the region uid?' - ); - $this->addArgument( - 'query', - InputArgument::OPTIONAL, - 'What is the additional query "q" parameter?' - ); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - Bootstrap::initializeBackendAuthentication(); - - $regionUid = $input->getArgument('region-uid'); - if (is_numeric($regionUid)) { - $regionUid = (int) $regionUid; - } else { - $regionUid = null; - } - - $query = $input->getArgument('query'); - if (is_string($query) === false) { - $query = ''; - } - - $import = $this->importFactory->createFromArray([ - 'storage_pid' => $input->getArgument('storage-pid'), - - 'files_folder' => $input->getArgument('files-folder'), - - 'region_uid' => $regionUid, - - 'rest_experience' => $input->getArgument('rest-experience'), - 'rest_search_query' => $query, - ]); - - return $this->destinationDataImportService->import( - $import - ); - } -} diff --git a/Classes/Controller/DateController.php b/Classes/Controller/DateController.php index 5b8e137..9d470f5 100644 --- a/Classes/Controller/DateController.php +++ b/Classes/Controller/DateController.php @@ -18,9 +18,6 @@ use Wrm\Events\Events\Controller\DateSearchVariables; use Wrm\Events\Pagination\Factory; use Wrm\Events\Service\DataProcessingForModels; -/** - * DateController - */ class DateController extends AbstractController { /** @@ -104,7 +101,7 @@ class DateController extends AbstractController ): void { $demand = $this->demandFactory->fromSettings($this->settings); if ($search !== []) { - $demand = DateDemand::createFromRequestValues($search, $this->settings); + $demand = $this->demandFactory->createFromRequestValues($search, $this->settings); } $dates = $this->dateRepository->findByDemand($demand); @@ -132,7 +129,7 @@ class DateController extends AbstractController { $demand = $this->demandFactory->fromSettings($this->settings); if ($search !== []) { - $demand = DateDemand::createFromRequestValues($search, $this->settings); + $demand = $this->demandFactory->createFromRequestValues($search, $this->settings); } $event = $this->eventDispatcher->dispatch(new DateSearchVariables( diff --git a/Classes/Domain/DestinationData/ImportFactory.php b/Classes/Domain/DestinationData/ImportFactory.php index 32d423d..47669ae 100644 --- a/Classes/Domain/DestinationData/ImportFactory.php +++ b/Classes/Domain/DestinationData/ImportFactory.php @@ -99,13 +99,7 @@ class ImportFactory return $result; } - /** - * Only public in order to be used by LegacyImportFactory. - * Make private once the class is removed. - * - * @internal - */ - public function create(array $data): Import + private function create(array $data): Import { $this->createWorkarounds($data); diff --git a/Classes/Domain/DestinationData/LegacyImportFactory.php b/Classes/Domain/DestinationData/LegacyImportFactory.php deleted file mode 100644 index 07a85ae..0000000 --- a/Classes/Domain/DestinationData/LegacyImportFactory.php +++ /dev/null @@ -1,103 +0,0 @@ -importFactory = $importFactory; - $this->resourceFactory = $resourceFactory; - $this->configurationManager = $configurationManager; - $this->extbasePersistenceSession = $extbasePersistenceSession; - } - - public function createFromArray(array $configuration): Import - { - $result = array_map('strval', $configuration); - - $result['uid'] = $this->getUniqueUid(); - - $result['files_folder'] = $this->migrateFileFolder($result['files_folder'] ?? ''); - - $result['region'] = $result['region_uid']; - unset($result['region_uid']); - - $result = $this->addCategorySettings($result); - - return $this->importFactory->create($result); - } - - private function getUniqueUid(): string - { - do { - // Only temporary solution as long as legacy exists. - // Cool solution would be to fetch highest uid + 100, but that's to much for now. - // Also this will vanish in future. - $uid = (string) random_int(999, PHP_INT_MAX); - } while ($this->extbasePersistenceSession->hasIdentifier($uid, Import::class)); - - return $uid; - } - - private function migrateFileFolder(string $fileFolder): string - { - $storage = $this->resourceFactory->getDefaultStorage(); - if ($storage === null) { - throw new \Exception('No default storage defined. Cancel import.', 1643290642); - } - - $uid = $storage->getUid(); - - return $uid . ':/' . trim($fileFolder, '/') . '/'; - } - - private function addCategorySettings(array $result): array - { - $settings = $this->configurationManager->getConfiguration( - ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, - 'Events', - 'Pi1' - ); - - $result['categories_pid'] = $settings['destinationData']['categoriesPid'] ?? ''; - $result['category_parent'] = $settings['destinationData']['categoryParentUid'] ?? ''; - - return $result; - } -} diff --git a/Classes/Domain/Model/Dto/DateDemand.php b/Classes/Domain/Model/Dto/DateDemand.php index bc81290..7c1cd66 100644 --- a/Classes/Domain/Model/Dto/DateDemand.php +++ b/Classes/Domain/Model/Dto/DateDemand.php @@ -100,56 +100,6 @@ class DateDemand */ protected $queryCallback = ''; - public static function createFromRequestValues( - array $submittedValues, - array $settings - ): self { - $instance = new self(); - $instance->setSearchword($submittedValues['searchword'] ?? ''); - $instance->setSynonyms($settings['synonyms'] ?? []); - - if (isset($submittedValues['locations']) && is_array($submittedValues['locations'])) { - $instance->setLocations($submittedValues['locations']); - } - - $instance->setRegions(GeneralUtility::intExplode(',', $submittedValues['region'] ?? '', true)); - if (isset($submittedValues['regions']) && is_array($submittedValues['regions'])) { - $instance->setRegions($submittedValues['regions']); - } - - if ($submittedValues['highlight'] ?? false) { - $instance->setHighlight(true); - } - - if (isset($submittedValues['start']) && $submittedValues['start'] !== '') { - $instance->setStart(strtotime($submittedValues['start'] . ' 00:00') ?: null); - } - if (isset($submittedValues['end']) && $submittedValues['end'] !== '') { - $instance->setEnd(strtotime($submittedValues['end'] . ' 23:59') ?: null); - } - if (isset($submittedValues['considerDate']) && $submittedValues['considerDate'] !== '') { - $instance->setConsiderDate((bool)$submittedValues['considerDate']); - } - - if (isset($submittedValues['userCategories']) && is_array($submittedValues['userCategories'])) { - $instance->setUserCategories($submittedValues['userCategories']); - } - - if (isset($submittedValues['features']) && is_array($submittedValues['features'])) { - $instance->setFeatures($submittedValues['features']); - } - - $instance->setSortBy($settings['sortByDate'] ?? ''); - $instance->setSortOrder($settings['sortOrder'] ?? ''); - $instance->setQueryCallback($settings['queryCallback'] ?? ''); - - if (!empty($settings['limit'])) { - $instance->setLimit($settings['limit']); - } - - return $instance; - } - public function getSortBy(): string { return $this->sortBy; diff --git a/Classes/Domain/Model/Dto/DateDemandFactory.php b/Classes/Domain/Model/Dto/DateDemandFactory.php index 711866b..352968d 100644 --- a/Classes/Domain/Model/Dto/DateDemandFactory.php +++ b/Classes/Domain/Model/Dto/DateDemandFactory.php @@ -105,4 +105,54 @@ class DateDemandFactory return $demand; } + + public function createFromRequestValues( + array $submittedValues, + array $settings + ): DateDemand { + $instance = new DateDemand(); + $instance->setSearchword($submittedValues['searchword'] ?? ''); + $instance->setSynonyms($settings['synonyms'] ?? []); + + if (isset($submittedValues['locations']) && is_array($submittedValues['locations'])) { + $instance->setLocations($submittedValues['locations']); + } + + $instance->setRegions(GeneralUtility::intExplode(',', $submittedValues['region'] ?? '', true)); + if (isset($submittedValues['regions']) && is_array($submittedValues['regions'])) { + $instance->setRegions($submittedValues['regions']); + } + + if ($submittedValues['highlight'] ?? false) { + $instance->setHighlight(true); + } + + if (isset($submittedValues['start']) && $submittedValues['start'] !== '') { + $instance->setStart(strtotime($submittedValues['start'] . ' 00:00') ?: null); + } + if (isset($submittedValues['end']) && $submittedValues['end'] !== '') { + $instance->setEnd(strtotime($submittedValues['end'] . ' 23:59') ?: null); + } + if (isset($submittedValues['considerDate']) && $submittedValues['considerDate'] !== '') { + $instance->setConsiderDate((bool)$submittedValues['considerDate']); + } + + if (isset($submittedValues['userCategories']) && is_array($submittedValues['userCategories'])) { + $instance->setUserCategories($submittedValues['userCategories']); + } + + if (isset($submittedValues['features']) && is_array($submittedValues['features'])) { + $instance->setFeatures($submittedValues['features']); + } + + $instance->setSortBy($settings['sortByDate'] ?? ''); + $instance->setSortOrder($settings['sortOrder'] ?? ''); + $instance->setQueryCallback($settings['queryCallback'] ?? ''); + + if (!empty($settings['limit'])) { + $instance->setLimit($settings['limit']); + } + + return $instance; + } } diff --git a/Classes/Domain/Model/Event.php b/Classes/Domain/Model/Event.php index 6aeee21..6488d9f 100644 --- a/Classes/Domain/Model/Event.php +++ b/Classes/Domain/Model/Event.php @@ -140,55 +140,6 @@ class Event extends AbstractEntity */ protected $dataProcessing = null; - // Legacy location related info - - /** - * @var string - */ - protected $name = ''; - - /** - * @var string - */ - protected $street = ''; - - /** - * @var string - */ - protected $district = ''; - - /** - * @var string - */ - protected $city = ''; - - /** - * @var string - */ - protected $zip = ''; - - /** - * @var string - */ - protected $country = ''; - - /** - * @var string - */ - protected $phone = ''; - - /** - * @var string - */ - protected $latitude = ''; - - /** - * @var string - */ - protected $longitude = ''; - - // End of legacy location info - public function __construct() { $this->initStorageObjects(); @@ -406,21 +357,6 @@ class Event extends AbstractEntity public function setLocation(?Location $location): void { $this->location = $location; - - // Keep this block as long as event still has the properties for legacy reasons. - // This ensures there is only a single point of truth, the new location object. - // That way we detect issues earlier and can migrate them until we get rid of the legacy code base. - if ($location instanceof Location) { - $this->name = ''; - $this->street = ''; - $this->district = ''; - $this->city = ''; - $this->zip = ''; - $this->country = ''; - $this->phone = ''; - $this->latitude = ''; - $this->longitude = ''; - } } public function getLocation(): ?Location @@ -533,87 +469,4 @@ class Event extends AbstractEntity { return $this->_localizedUid; } - - // Legacy location related info - - public function getName(): string - { - if ($this->location instanceof Location) { - return $this->location->getName(); - } - - return $this->name; - } - - public function getStreet(): string - { - if ($this->location instanceof Location) { - return $this->location->getStreet(); - } - - return $this->street; - } - - public function getDistrict(): string - { - if ($this->location instanceof Location) { - return $this->location->getDistrict(); - } - - return $this->district; - } - - public function getCountry(): string - { - if ($this->location instanceof Location) { - return $this->location->getCountry(); - } - - return $this->country; - } - - public function getCity(): string - { - if ($this->location instanceof Location) { - return $this->location->getCity(); - } - - return $this->city; - } - - public function getZip(): string - { - if ($this->location instanceof Location) { - return $this->location->getZip(); - } - - return $this->zip; - } - - public function getPhone(): string - { - if ($this->location instanceof Location) { - return $this->location->getPhone(); - } - - return $this->phone; - } - - public function getLatitude(): string - { - if ($this->location instanceof Location) { - return $this->location->getLatitude(); - } - - return $this->latitude; - } - - public function getLongitude(): string - { - if ($this->location instanceof Location) { - return $this->location->getLongitude(); - } - - return $this->longitude; - } } diff --git a/Classes/ViewHelpers/FormViewHelper.php b/Classes/ViewHelpers/FormViewHelper.php deleted file mode 100644 index d7af5f8..0000000 --- a/Classes/ViewHelpers/FormViewHelper.php +++ /dev/null @@ -1,11 +0,0 @@ - 'trim' ] ], - 'name' => [ - 'exclude' => true, - 'label' => $l10nLocationPath . ':tx_events_domain_model_location.name', - 'config' => [ - 'type' => 'input', - 'size' => 30, - 'eval' => 'trim' - ], - ], - 'street' => [ - 'exclude' => true, - 'label' => $l10nLocationPath . ':tx_events_domain_model_location.street', - 'config' => [ - 'type' => 'input', - 'size' => 30, - 'eval' => 'trim' - ], - ], - 'district' => [ - 'exclude' => true, - 'label' => $l10nLocationPath . ':tx_events_domain_model_location.district', - 'config' => [ - 'type' => 'input', - 'size' => 30, - 'eval' => 'trim' - ], - ], - 'city' => [ - 'exclude' => true, - 'label' => $l10nLocationPath . ':tx_events_domain_model_location.city', - 'config' => [ - 'type' => 'input', - 'size' => 30, - 'eval' => 'trim' - ], - ], - 'zip' => [ - 'exclude' => true, - 'label' => $l10nLocationPath . ':tx_events_domain_model_location.zip', - 'config' => [ - 'type' => 'input', - 'size' => 30, - 'eval' => 'trim' - ], - ], - 'country' => [ - 'exclude' => true, - 'label' => $l10nLocationPath . ':tx_events_domain_model_location.country', - 'config' => [ - 'type' => 'input', - 'size' => 30, - 'eval' => 'trim' - ], - ], - 'phone' => [ - 'exclude' => true, - 'label' => $l10nLocationPath . ':tx_events_domain_model_location.phone', - 'config' => [ - 'type' => 'input', - 'size' => 30, - 'eval' => 'trim' - ], - ], 'web' => [ 'exclude' => true, 'label' => $l10nPath . ':tx_events_domain_model_event.web', @@ -374,24 +302,6 @@ return [ 'eval' => 'trim' ], ], - 'latitude' => [ - 'exclude' => true, - 'label' => $l10nLocationPath . ':tx_events_domain_model_location.latitude', - 'config' => [ - 'type' => 'input', - 'size' => 30, - 'eval' => 'trim' - ], - ], - 'longitude' => [ - 'exclude' => true, - 'label' => $l10nLocationPath . ':tx_events_domain_model_location.longitude', - 'config' => [ - 'type' => 'input', - 'size' => 30, - 'eval' => 'trim' - ], - ], 'images' => [ 'exclude' => true, 'label' => $l10nPath . ':tx_events_domain_model_event.images', diff --git a/Documentation/Changelog/3.0.0.rst b/Documentation/Changelog/3.0.0.rst index 3f6fdde..06000c9 100644 --- a/Documentation/Changelog/3.0.0.rst +++ b/Documentation/Changelog/3.0.0.rst @@ -30,6 +30,21 @@ string value necessary or Fluid forms. Those are not considered public API. Use ``getStartObject()`` and ``getEndObject()`` instead. +The static method ``createFromRequestValues()`` was moved as an instance method to +the factory, in order to streamline factories. + +The old location properties were removed from events. +The locations are imported as dedicated instance already. +The corresponding TCA and database columns got removed as well. + +The Form ViewHelper got removed as it was unused. + +Removed command +^^^^^^^^^^^^^^^ + +The legacy command was removed. It now is necessary to create import configurations +and use new commands to import those configurations. + Features -------- diff --git a/Tests/Functional/Import/DestinationDataTest/AbstractTest.php b/Tests/Functional/Import/DestinationDataTest/AbstractTest.php index 61cc8f4..acc6564 100644 --- a/Tests/Functional/Import/DestinationDataTest/AbstractTest.php +++ b/Tests/Functional/Import/DestinationDataTest/AbstractTest.php @@ -11,7 +11,7 @@ use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Context\DateTimeAspect; use TYPO3\CMS\Core\Localization\LanguageServiceFactory; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; -use Wrm\Events\Command\DestinationDataImportCommand; +use Wrm\Events\Command\ImportDestinationDataViaConfigruationCommand; use Wrm\Events\Tests\ClientFactory; abstract class AbstractTest extends FunctionalTestCase @@ -72,8 +72,8 @@ abstract class AbstractTest extends FunctionalTestCase } protected function executeCommand( - array $argumentsAndOptions, - string $command = DestinationDataImportCommand::class + array $argumentsAndOptions = ['configurationUid' => '1'], + string $command = ImportDestinationDataViaConfigruationCommand::class ): CommandTester { $subject = $this->getContainer()->get($command); self::assertInstanceOf(Command::class, $subject); diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv index 8d2b104..650b87f 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv @@ -1,51 +1,51 @@ -"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","phone","ticket","facebook","youtube","instagram","images","categories","pages","dates","organizer","partner","region","references_events","location","name","street","district","city","zip","country","latitude","longitude" +"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" ,"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,,,,,,,, +Es gilt die 2G-PLUS-Regel.",,"http://www.schillerhaus.rudolstadt.de/",,,,,"1","1",,"1","1",,"1",,1 ,"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,,,,,,,, +Bitte beachten Sie die derzeit geltenden Zugangsregeln.",,"http://www.stadtbibliothek-rudolstadt.de/",,,,,"1","1",,"4","2",,"1",,2 ,"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,,,,,,,, -"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",,,,,,,,,,,,,,,,,,,,,,,,,,,, -"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.720971023259","11.335229873657","+ 49 3672 / 486470",,,,,,,,,,,,,,,,,,,,,,,, -,"2","2","0","0","0","0",-1,0,"0","0","0","Stadtbibliothek Rudolstadt","Schulplatz 13",,"Rudolstadt","07407","Deutschland","50.720835175056","11.342568397522","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.718688721183","11.327333450317","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",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Es gilt die 2G-PLUS-Regel.",,,,,,,"1","2",,"8","3",,"1",,3 +"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",,,,,,,,,,,,,,,,,,, +"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.720971023259","11.335229873657","+ 49 3672 / 486470",,,,,,,,,,,,,,, +,"2","2","0","0","0","0",-1,0,"0","0","0","Stadtbibliothek Rudolstadt","Schulplatz 13",,"Rudolstadt","07407","Deutschland","50.720835175056","11.342568397522","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.718688721183","11.327333450317","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/Fixtures/DefaultImportConfiguration.xml b/Tests/Functional/Import/DestinationDataTest/Fixtures/DefaultImportConfiguration.xml new file mode 100644 index 0000000..af1a822 --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/DefaultImportConfiguration.xml @@ -0,0 +1,15 @@ + + + + 1 + 2 + Example import configuration + + 2 + 1:/staedte/beispielstadt/events/ + + 1 + + beispielstadt + + diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleImportConfigurationWithCategories.xml b/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleImportConfigurationWithCategories.xml new file mode 100644 index 0000000..75512cf --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleImportConfigurationWithCategories.xml @@ -0,0 +1,17 @@ + + + + 1 + 2 + Example import configuration + + 2 + 1:/staedte/beispielstadt/events/ + 2 + 2 + + 1 + + beispielstadt + + diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleImportConfigurationWithoutRegion.xml b/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleImportConfigurationWithoutRegion.xml new file mode 100644 index 0000000..b564772 --- /dev/null +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleImportConfigurationWithoutRegion.xml @@ -0,0 +1,13 @@ + + + + 1 + 2 + Example import configuration + + 2 + 1:/staedte/beispielstadt/events/ + + beispielstadt + + diff --git a/Tests/Functional/Import/DestinationDataTest/ImportCleansTransientFilesTest.php b/Tests/Functional/Import/DestinationDataTest/ImportCleansTransientFilesTest.php index a3a6532..6af2260 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportCleansTransientFilesTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportCleansTransientFilesTest.php @@ -20,6 +20,7 @@ class ImportCleansTransientFilesTest extends AbstractTest $fileImportPath = $this->getInstancePath() . '/fileadmin/' . $fileImportPathConfiguration; GeneralUtility::mkdir_deep($fileImportPath); + $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/DefaultImportConfiguration.xml'); $this->setUpConfiguration([ 'restUrl = https://example.com/some-path/', 'license = example-license', @@ -27,8 +28,6 @@ class ImportCleansTransientFilesTest extends AbstractTest 'restLimit = 3', 'restMode = next_months,12', 'restTemplate = ET2014A.json', - 'categoriesPid = ', - 'categoryParentUid = ', ]); $requests = &$this->setUpResponses([ @@ -38,11 +37,7 @@ class ImportCleansTransientFilesTest extends AbstractTest new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ExampleImage.jpg') ?: ''), ]); - $tester = $this->executeCommand([ - 'storage-pid' => '2', - 'rest-experience' => 'beispielstadt', - 'files-folder' => $fileImportPathConfiguration, - ]); + $tester = $this->executeCommand(); self::assertSame(0, $tester->getStatusCode()); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportDoesNotUseUploadsFolderTest.php b/Tests/Functional/Import/DestinationDataTest/ImportDoesNotUseUploadsFolderTest.php index e7f928f..e7a338f 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportDoesNotUseUploadsFolderTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportDoesNotUseUploadsFolderTest.php @@ -20,6 +20,7 @@ class ImportDoesNotUseUploadsFolderTest extends AbstractTest $fileImportPath = $this->getInstancePath() . '/fileadmin/' . $fileImportPathConfiguration; GeneralUtility::mkdir_deep($fileImportPath); + $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/DefaultImportConfiguration.xml'); $this->setUpConfiguration([ 'restUrl = https://example.com/some-path/', 'license = example-license', @@ -27,8 +28,6 @@ class ImportDoesNotUseUploadsFolderTest extends AbstractTest 'restLimit = 3', 'restMode = next_months,12', 'restTemplate = ET2014A.json', - 'categoriesPid = ', - 'categoryParentUid = ', ]); $requests = &$this->setUpResponses([ @@ -38,11 +37,7 @@ class ImportDoesNotUseUploadsFolderTest extends AbstractTest new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ExampleImage.jpg') ?: ''), ]); - $tester = $this->executeCommand([ - 'storage-pid' => '2', - 'rest-experience' => 'beispielstadt', - 'files-folder' => $fileImportPathConfiguration, - ]); + $tester = $this->executeCommand(); self::assertSame(0, $tester->getStatusCode()); self::assertCount(4, $requests, 'Unexpected number of requests were made.'); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportDoesntBreakWithLongFileTitleTest.php b/Tests/Functional/Import/DestinationDataTest/ImportDoesntBreakWithLongFileTitleTest.php index c63fb48..4a89ff7 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportDoesntBreakWithLongFileTitleTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportDoesntBreakWithLongFileTitleTest.php @@ -16,6 +16,7 @@ class ImportDoesntBreakWithLongFileTitleTest extends AbstractTest $fileImportPath = $this->getInstancePath() . '/fileadmin/' . $fileImportPathConfiguration; GeneralUtility::mkdir_deep($fileImportPath); + $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleImportConfigurationWithCategories.xml'); $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleRegion.xml'); $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleCategory.xml'); $this->setUpConfiguration([ @@ -25,8 +26,6 @@ class ImportDoesntBreakWithLongFileTitleTest extends AbstractTest 'restLimit = 3', 'restMode = next_months,12', 'restTemplate = ET2014A.json', - 'categoriesPid = 2', - 'categoryParentUid = 2', ]); $requests = &$this->setUpResponses([ @@ -34,12 +33,7 @@ class ImportDoesntBreakWithLongFileTitleTest extends AbstractTest new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ExampleImage.jpg') ?: ''), ]); - $tester = $this->executeCommand([ - 'storage-pid' => '2', - 'rest-experience' => 'beispielstadt', - 'files-folder' => $fileImportPathConfiguration, - 'region-uid' => '1', - ]); + $tester = $this->executeCommand(); self::assertSame(0, $tester->getStatusCode()); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportDoesntEndUpInEndlessDateCreationTest.php b/Tests/Functional/Import/DestinationDataTest/ImportDoesntEndUpInEndlessDateCreationTest.php index badef81..d990047 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportDoesntEndUpInEndlessDateCreationTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportDoesntEndUpInEndlessDateCreationTest.php @@ -19,6 +19,7 @@ class ImportDoesntEndUpInEndlessDateCreationTest extends AbstractTest GeneralUtility::mkdir_deep($fileImportPath); $this->setDateAspect(new \DateTimeImmutable('2022-07-01'), new \DateTimeZone('Europe/Berlin')); + $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/DefaultImportConfiguration.xml'); $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleRegion.xml'); $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleCategory.xml'); $this->setUpConfiguration([ @@ -28,20 +29,13 @@ class ImportDoesntEndUpInEndlessDateCreationTest extends AbstractTest 'restLimit = 3', 'restMode = next_months,12', 'restTemplate = ET2014A.json', - 'categoriesPid = 2', - 'categoryParentUid = 2', ]); $requests = &$this->setUpResponses([ new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithPotentiellyEndlessDateCreation.json') ?: ''), ]); - $tester = $this->executeCommand([ - 'storage-pid' => '2', - 'rest-experience' => 'beispielstadt', - 'files-folder' => $fileImportPathConfiguration, - 'region-uid' => '1', - ]); + $tester = $this->executeCommand(); self::assertSame(0, $tester->getStatusCode()); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsExampleAsExpectedTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsExampleAsExpectedTest.php index 79d48a3..e481798 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsExampleAsExpectedTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsExampleAsExpectedTest.php @@ -21,6 +21,7 @@ class ImportsExampleAsExpectedTest extends AbstractTest $fileImportPath = $this->getInstancePath() . '/fileadmin/' . $fileImportPathConfiguration; GeneralUtility::mkdir_deep($fileImportPath); + $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleImportConfigurationWithCategories.xml'); $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleRegion.xml'); $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleCategory.xml'); $this->setUpConfiguration([ @@ -30,8 +31,6 @@ class ImportsExampleAsExpectedTest extends AbstractTest 'restLimit = 3', 'restMode = next_months,12', 'restTemplate = ET2014A.json', - 'categoriesPid = 2', - 'categoryParentUid = 2', ]); $requests = &$this->setUpResponses([ @@ -41,12 +40,7 @@ class ImportsExampleAsExpectedTest extends AbstractTest new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ExampleImage.jpg') ?: ''), ]); - $tester = $this->executeCommand([ - 'storage-pid' => '2', - 'rest-experience' => 'beispielstadt', - 'files-folder' => $fileImportPathConfiguration, - 'region-uid' => '1', - ]); + $tester = $this->executeCommand(); self::assertSame(0, $tester->getStatusCode()); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsFeaturesTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsFeaturesTest.php index c551ab0..0f9525b 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsFeaturesTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsFeaturesTest.php @@ -24,9 +24,7 @@ class ImportsFeaturesTest extends AbstractTest $this->setUpResponses([ new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithFeatures.json') ?: ''), ]); - $tester = $this->executeCommand([ - 'configurationUid' => '1', - ], ImportDestinationDataViaConfigruationCommand::class); + $tester = $this->executeCommand(); $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFeaturesAddsNewFeatures.csv'); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsFirstDateOfDatesTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsFirstDateOfDatesTest.php index 6e15010..25128fd 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsFirstDateOfDatesTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsFirstDateOfDatesTest.php @@ -28,7 +28,7 @@ class ImportsFirstDateOfDatesTest extends AbstractTest { $this->setUpResponses([new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithSingleDate.json') ?: '')]); - $this->executeCommand(['configurationUid' => '1'], ImportDestinationDataViaConfigruationCommand::class); + $this->executeCommand(); $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfSingleDate.csv'); self::assertFileEquals( @@ -45,7 +45,7 @@ class ImportsFirstDateOfDatesTest extends AbstractTest { $this->setUpResponses([new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithRecurringWeekly.json') ?: '')]); - $this->executeCommand(['configurationUid' => '1'], ImportDestinationDataViaConfigruationCommand::class); + $this->executeCommand(); $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesWeekly.csv'); self::assertFileEquals( @@ -62,7 +62,7 @@ class ImportsFirstDateOfDatesTest extends AbstractTest { $this->setUpResponses([new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithRecurringDaily.json') ?: '')]); - $this->executeCommand(['configurationUid' => '1'], ImportDestinationDataViaConfigruationCommand::class); + $this->executeCommand(); $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsFirstDateOfRecurringDatesDaily.csv'); self::assertFileEquals( diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsSingleConfigurationTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsSingleConfigurationTest.php index 70b628e..91ae47f 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsSingleConfigurationTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsSingleConfigurationTest.php @@ -41,9 +41,7 @@ class ImportsSingleConfigurationTest extends AbstractTest new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ExampleImage.jpg') ?: ''), ]); - $tester = $this->executeCommand([ - 'configurationUid' => '1', - ], ImportDestinationDataViaConfigruationCommand::class); + $tester = $this->executeCommand(); self::assertSame(0, $tester->getStatusCode()); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsTicketsTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsTicketsTest.php index f5202f6..1ce0e34 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsTicketsTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsTicketsTest.php @@ -21,6 +21,7 @@ class ImportsTicketsTest extends AbstractTest $fileImportPath = $this->getInstancePath() . '/fileadmin/' . $fileImportPathConfiguration; GeneralUtility::mkdir_deep($fileImportPath); + $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/DefaultImportConfiguration.xml'); $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleRegion.xml'); $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleCategory.xml'); $this->setUpConfiguration([ @@ -30,20 +31,13 @@ class ImportsTicketsTest extends AbstractTest 'restLimit = 3', 'restMode = next_months,12', 'restTemplate = ET2014A.json', - 'categoriesPid = 2', - 'categoryParentUid = 2', ]); $requests = &$this->setUpResponses([ new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithTickets.json') ?: ''), ]); - $tester = $this->executeCommand([ - 'storage-pid' => '2', - 'rest-experience' => 'beispielstadt', - 'files-folder' => $fileImportPathConfiguration, - 'region-uid' => '1', - ]); + $tester = $this->executeCommand(); self::assertSame(0, $tester->getStatusCode()); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsWithLocationsTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsWithLocationsTest.php index 3b39788..6e5226c 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsWithLocationsTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsWithLocationsTest.php @@ -19,6 +19,8 @@ class ImportsWithLocationsTest extends AbstractTest $fileImportPath = $this->getInstancePath() . '/fileadmin/' . $fileImportPathConfiguration; GeneralUtility::mkdir_deep($fileImportPath); + $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/DefaultImportConfiguration.xml'); + $this->setUpConfiguration([ 'restUrl = https://example.com/some-path/', 'license = example-license', @@ -31,12 +33,7 @@ class ImportsWithLocationsTest extends AbstractTest $requests = &$this->setUpResponses([ new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithLocations.json') ?: ''), ]); - $tester = $this->executeCommand([ - 'storage-pid' => '2', - 'rest-experience' => 'beispielstadt', - 'files-folder' => $fileImportPathConfiguration, - 'region-uid' => '', - ]); + $tester = $this->executeCommand(); self::assertSame(0, $tester->getStatusCode()); $this->assertCSVDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsWithLocations.csv'); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutCategoryIfNotProvidedTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutCategoryIfNotProvidedTest.php index 3c630d7..f2bd97e 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutCategoryIfNotProvidedTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutCategoryIfNotProvidedTest.php @@ -19,6 +19,7 @@ class ImportsWithoutCategoryIfNotProvidedTest extends AbstractTest $fileImportPath = $this->getInstancePath() . '/fileadmin/' . $fileImportPathConfiguration; GeneralUtility::mkdir_deep($fileImportPath); + $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/DefaultImportConfiguration.xml'); $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleRegion.xml'); $this->setUpConfiguration([ 'restUrl = https://example.com/some-path/', @@ -27,8 +28,6 @@ class ImportsWithoutCategoryIfNotProvidedTest extends AbstractTest 'restLimit = 3', 'restMode = next_months,12', 'restTemplate = ET2014A.json', - 'categoriesPid = ', - 'categoryParentUid = ', ]); $requests = &$this->setUpResponses([ @@ -38,12 +37,7 @@ class ImportsWithoutCategoryIfNotProvidedTest extends AbstractTest new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ExampleImage.jpg') ?: ''), ]); - $tester = $this->executeCommand([ - 'storage-pid' => '2', - 'rest-experience' => 'beispielstadt', - 'files-folder' => $fileImportPathConfiguration, - 'region-uid' => '1', - ]); + $tester = $this->executeCommand(); self::assertSame(0, $tester->getStatusCode()); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutLocationTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutLocationTest.php index 3afccb3..0a88be4 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutLocationTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutLocationTest.php @@ -19,6 +19,7 @@ class ImportsWithoutLocationTest extends AbstractTest $fileImportPath = $this->getInstancePath() . '/fileadmin/' . $fileImportPathConfiguration; GeneralUtility::mkdir_deep($fileImportPath); + $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleImportConfigurationWithoutRegion.xml'); $this->setUpConfiguration([ 'restUrl = https://example.com/some-path/', 'license = example-license', @@ -31,12 +32,7 @@ class ImportsWithoutLocationTest extends AbstractTest $requests = &$this->setUpResponses([ new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithoutLocation.json') ?: ''), ]); - $tester = $this->executeCommand([ - 'storage-pid' => '2', - 'rest-experience' => 'beispielstadt', - 'files-folder' => $fileImportPathConfiguration, - 'region-uid' => '', - ]); + $tester = $this->executeCommand(); self::assertSame(0, $tester->getStatusCode()); self::assertCount( diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutRegionIfNotProvidedTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutRegionIfNotProvidedTest.php index 250e883..4f115f9 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutRegionIfNotProvidedTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutRegionIfNotProvidedTest.php @@ -19,6 +19,7 @@ class ImportsWithoutRegionIfNotProvidedTest extends AbstractTest $fileImportPath = $this->getInstancePath() . '/fileadmin/' . $fileImportPathConfiguration; GeneralUtility::mkdir_deep($fileImportPath); + $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleImportConfigurationWithoutRegion.xml'); $this->importDataSet('EXT:events/Tests/Functional/Import/DestinationDataTest/Fixtures/SingleCategory.xml'); $this->setUpConfiguration([ 'restUrl = https://example.com/some-path/', @@ -27,8 +28,6 @@ class ImportsWithoutRegionIfNotProvidedTest extends AbstractTest 'restLimit = 3', 'restMode = next_months,12', 'restTemplate = ET2014A.json', - 'categoriesPid = 2', - 'categoryParentUid = 2', ]); $requests = &$this->setUpResponses([ @@ -37,12 +36,7 @@ class ImportsWithoutRegionIfNotProvidedTest extends AbstractTest new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ExampleImage.jpg') ?: ''), new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ExampleImage.jpg') ?: ''), ]); - $tester = $this->executeCommand([ - 'storage-pid' => '2', - 'rest-experience' => 'beispielstadt', - 'files-folder' => $fileImportPathConfiguration, - 'region-uid' => '', - ]); + $tester = $this->executeCommand(); self::assertSame(0, $tester->getStatusCode()); diff --git a/Tests/Unit/Domain/Model/Dto/DateDemandFactoryTest.php b/Tests/Unit/Domain/Model/Dto/DateDemandFactoryTest.php index 76f0420..7282308 100644 --- a/Tests/Unit/Domain/Model/Dto/DateDemandFactoryTest.php +++ b/Tests/Unit/Domain/Model/Dto/DateDemandFactoryTest.php @@ -34,17 +34,15 @@ use Wrm\Events\Tests\ProphecyTrait; */ class DateDemandFactoryTest extends TestCase { - use ProphecyTrait; - /** * @test */ public function canBeCreated(): void { - $typoScriptService = $this->prophesize(TypoScriptService::class); + $typoScriptService = $this->createStub(TypoScriptService::class); $subject = new DateDemandFactory( - $typoScriptService->reveal() + $typoScriptService ); self::assertInstanceOf( @@ -58,10 +56,10 @@ class DateDemandFactoryTest extends TestCase */ public function fromSettingsDoesNotThrowUndefinedArrayKeyWarnings(): void { - $typoScriptService = $this->prophesize(TypoScriptService::class); + $typoScriptService = $this->createStub(TypoScriptService::class); $subject = new DateDemandFactory( - $typoScriptService->reveal() + $typoScriptService ); $result = $subject->fromSettings([]); @@ -71,4 +69,408 @@ class DateDemandFactoryTest extends TestCase $result ); } + + /** + * @test + */ + public function searchWordIsSetByRequest(): void + { + $typoScriptService = $this->createStub(TypoScriptService::class); + + $subject = new DateDemandFactory( + $typoScriptService + ); + $result = $subject->createFromRequestValues( + [ + 'searchword' => 'This is the search word', + ], + [ + ] + ); + + self::assertSame( + 'This is the search word', + $result->getSearchword() + ); + } + + /** + * @test + */ + public function synonymsAreSetBySettings(): void + { + $typoScriptService = $this->createStub(TypoScriptService::class); + + $subject = new DateDemandFactory( + $typoScriptService + ); + $result = $subject->createFromRequestValues( + [ + 'searchword' => 'synonym1', + ], + [ + 'synonyms' => [ + [ + 'word' => 'Word1', + 'synonyms' => 'synonym1, synonym2', + ], + [ + 'word' => 'Word2', + 'synonyms' => 'synonym3, synonym4', + ], + [ + 'word' => 'Word3', + 'synonyms' => 'synonym1', + ], + ], + ] + ); + + self::assertSame( + [ + 'Word1', + 'Word3', + ], + $result->getSynonymsForSearchword() + ); + } + + /** + * @test + */ + public function categoriesAreSetByRequest(): void + { + $typoScriptService = $this->createStub(TypoScriptService::class); + + $subject = new DateDemandFactory( + $typoScriptService + ); + $result = $subject->createFromRequestValues( + [ + 'userCategories' => [ + '10', '20', + ], + ], + [ + ] + ); + + self::assertSame( + [ + 10, + 20, + ], + $result->getUserCategories() + ); + } + + /** + * @test + */ + public function featuresAreSetByRequest(): void + { + $typoScriptService = $this->createStub(TypoScriptService::class); + + $subject = new DateDemandFactory( + $typoScriptService + ); + $result = $subject->createFromRequestValues( + [ + 'features' => [ + '10', '20', + ], + ], + [ + ] + ); + + self::assertSame( + [ + 10, + 20, + ], + $result->getFeatures() + ); + } + + /** + * @test + */ + public function regionIsSetByRequest(): void + { + $typoScriptService = $this->createStub(TypoScriptService::class); + + $subject = new DateDemandFactory( + $typoScriptService + ); + $result = $subject->createFromRequestValues( + [ + 'region' => '10', + ], + [ + ] + ); + + self::assertSame( + [ + 10, + ], + $result->getRegions() + ); + self::assertSame( + '10', + $result->getRegion() + ); + } + + /** + * @test + */ + public function regionsAreSetByRequest(): void + { + $typoScriptService = $this->createStub(TypoScriptService::class); + + $subject = new DateDemandFactory( + $typoScriptService + ); + $result = $subject->createFromRequestValues( + [ + 'regions' => [ + '10', '20', + ], + ], + [ + ] + ); + + self::assertSame( + [ + 10, + 20, + ], + $result->getRegions() + ); + self::assertSame( + '10,20', + $result->getRegion() + ); + } + + /** + * @test + */ + public function startIsSetByRequest(): void + { + $typoScriptService = $this->createStub(TypoScriptService::class); + + $subject = new DateDemandFactory( + $typoScriptService + ); + $result = $subject->createFromRequestValues( + [ + 'start' => '2022-07-12', + ], + [ + ] + ); + + self::assertInstanceOf( + \DateTimeImmutable::class, + $result->getStartObject() + ); + self::assertSame( + '2022-07-12', + $result->getStartObject()->format('Y-m-d') + ); + self::assertSame( + '2022-07-12', + $result->getStart() + ); + } + + /** + * @test + */ + public function endIsSetByRequest(): void + { + $typoScriptService = $this->createStub(TypoScriptService::class); + + $subject = new DateDemandFactory( + $typoScriptService + ); + $result = $subject->createFromRequestValues( + [ + 'end' => '2022-07-12', + ], + [ + ] + ); + + self::assertInstanceOf( + \DateTimeImmutable::class, + $result->getEndObject() + ); + self::assertSame( + '2022-07-12', + $result->getEndObject()->format('Y-m-d') + ); + self::assertSame( + '2022-07-12', + $result->getEnd() + ); + } + + /** + * @test + * @dataProvider possibleEndAndStartNullCombinations + */ + public function returnsEndsOnSameDayIfAnyIsNull( + string $start, + string $end + ): void { + $typoScriptService = $this->createStub(TypoScriptService::class); + + $subject = new DateDemandFactory( + $typoScriptService + ); + $result = $subject->createFromRequestValues( + [ + 'start' => $start, + 'end' => $end, + ], + [ + ] + ); + + self::assertTrue( + $result->getEndsOnSameDay() + ); + } + + public function possibleEndAndStartNullCombinations(): \Generator + { + yield 'Both are empty' => [ + 'start' => '', + 'end' => '', + ]; + yield 'Start is empty' => [ + 'start' => '', + 'end' => '2022-07-12', + ]; + yield 'End is empty' => [ + 'start' => '2022-07-12', + 'end' => '', + ]; + } + + /** + * @test + */ + public function returnsEndsOnSameDayIfBothAreOnSameDay(): void + { + $typoScriptService = $this->createStub(TypoScriptService::class); + + $subject = new DateDemandFactory( + $typoScriptService + ); + $result = $subject->createFromRequestValues( + [ + 'start' => '2022-07-12', + 'end' => '2022-07-12', + ], + [ + ] + ); + + self::assertTrue( + $result->getEndsOnSameDay() + ); + } + + /** + * @test + */ + public function returnsEndsOnSameDayIfBothAreOnDifferentDays(): void + { + $typoScriptService = $this->createStub(TypoScriptService::class); + + $subject = new DateDemandFactory( + $typoScriptService + ); + $result = $subject->createFromRequestValues( + [ + 'start' => '2022-07-12', + 'end' => '2022-07-13', + ], + [ + ] + ); + + self::assertFalse( + $result->getEndsOnSameDay() + ); + } + + /** + * @test + * @dataProvider possibleSubmittedHighlights + * + * @param mixed $highlight + */ + public function returnsHighlightIfSet($highlight): void + { + $typoScriptService = $this->createStub(TypoScriptService::class); + + $subject = new DateDemandFactory( + $typoScriptService + ); + $result = $subject->createFromRequestValues( + [ + 'highlight' => $highlight, + ], + [ + ] + ); + + self::assertTrue($result->getHighlight()); + } + + public 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 + { + $typoScriptService = $this->createStub(TypoScriptService::class); + + $subject = new DateDemandFactory( + $typoScriptService + ); + $result = $subject->createFromRequestValues( + [ + 'highlight' => $highlight, + ], + [ + ] + ); + + self::assertFalse($result->getHighlight()); + } + + public function possibleSubmittedFalsyHighlights(): \Generator + { + yield 'false' => ['highlight' => false]; + yield '0 as integer' => ['highlight' => 0]; + yield '0 as string' => ['highlight' => '0']; + yield 'empty string' => ['highlight' => '']; + } } diff --git a/Tests/Unit/Domain/Model/Dto/DateDemandTest.php b/Tests/Unit/Domain/Model/Dto/DateDemandTest.php deleted file mode 100644 index 8682488..0000000 --- a/Tests/Unit/Domain/Model/Dto/DateDemandTest.php +++ /dev/null @@ -1,364 +0,0 @@ - 'This is the search word', - ], - [ - ] - ); - - self::assertSame( - 'This is the search word', - $result->getSearchword() - ); - } - - /** - * @test - */ - public function synonymsAreSetBySettings(): void - { - $result = DateDemand::createFromRequestValues( - [ - 'searchword' => 'synonym1', - ], - [ - 'synonyms' => [ - [ - 'word' => 'Word1', - 'synonyms' => 'synonym1, synonym2', - ], - [ - 'word' => 'Word2', - 'synonyms' => 'synonym3, synonym4', - ], - [ - 'word' => 'Word3', - 'synonyms' => 'synonym1', - ], - ], - ] - ); - - self::assertSame( - [ - 'Word1', - 'Word3', - ], - $result->getSynonymsForSearchword() - ); - } - - /** - * @test - */ - public function categoriesAreSetByRequest(): void - { - $result = DateDemand::createFromRequestValues( - [ - 'userCategories' => [ - '10', '20', - ], - ], - [ - ] - ); - - self::assertSame( - [ - 10, - 20, - ], - $result->getUserCategories() - ); - } - - /** - * @test - */ - public function featuresAreSetByRequest(): void - { - $result = DateDemand::createFromRequestValues( - [ - 'features' => [ - '10', '20', - ], - ], - [ - ] - ); - - self::assertSame( - [ - 10, - 20, - ], - $result->getFeatures() - ); - } - - /** - * @test - */ - public function regionIsSetByRequest(): void - { - $result = DateDemand::createFromRequestValues( - [ - 'region' => '10', - ], - [ - ] - ); - - self::assertSame( - [ - 10, - ], - $result->getRegions() - ); - self::assertSame( - '10', - $result->getRegion() - ); - } - - /** - * @test - */ - public function regionsAreSetByRequest(): void - { - $result = DateDemand::createFromRequestValues( - [ - 'regions' => [ - '10', '20', - ], - ], - [ - ] - ); - - self::assertSame( - [ - 10, - 20, - ], - $result->getRegions() - ); - self::assertSame( - '10,20', - $result->getRegion() - ); - } - - /** - * @test - */ - public function startIsSetByRequest(): void - { - $result = DateDemand::createFromRequestValues( - [ - 'start' => '2022-07-12', - ], - [ - ] - ); - - self::assertInstanceOf( - \DateTimeImmutable::class, - $result->getStartObject() - ); - self::assertSame( - '2022-07-12', - $result->getStartObject()->format('Y-m-d') - ); - self::assertSame( - '2022-07-12', - $result->getStart() - ); - } - - /** - * @test - */ - public function endIsSetByRequest(): void - { - $result = DateDemand::createFromRequestValues( - [ - 'end' => '2022-07-12', - ], - [ - ] - ); - - self::assertInstanceOf( - \DateTimeImmutable::class, - $result->getEndObject() - ); - self::assertSame( - '2022-07-12', - $result->getEndObject()->format('Y-m-d') - ); - self::assertSame( - '2022-07-12', - $result->getEnd() - ); - } - - /** - * @test - * @dataProvider possibleEndAndStartNullCombinations - */ - public function returnsEndsOnSameDayIfAnyIsNull( - string $start, - string $end - ): void { - $result = DateDemand::createFromRequestValues( - [ - 'start' => $start, - 'end' => $end, - ], - [ - ] - ); - - self::assertTrue( - $result->getEndsOnSameDay() - ); - } - - public function possibleEndAndStartNullCombinations(): \Generator - { - yield 'Both are empty' => [ - 'start' => '', - 'end' => '', - ]; - yield 'Start is empty' => [ - 'start' => '', - 'end' => '2022-07-12', - ]; - yield 'End is empty' => [ - 'start' => '2022-07-12', - 'end' => '', - ]; - } - - /** - * @test - */ - public function returnsEndsOnSameDayIfBothAreOnSameDay(): void - { - $result = DateDemand::createFromRequestValues( - [ - 'start' => '2022-07-12', - 'end' => '2022-07-12', - ], - [ - ] - ); - - self::assertTrue( - $result->getEndsOnSameDay() - ); - } - - /** - * @test - */ - public function returnsEndsOnSameDayIfBothAreOnDifferentDays(): void - { - $result = DateDemand::createFromRequestValues( - [ - 'start' => '2022-07-12', - 'end' => '2022-07-13', - ], - [ - ] - ); - - self::assertFalse( - $result->getEndsOnSameDay() - ); - } - - /** - * @test - * @dataProvider possibleSubmittedHighlights - * - * @param mixed $highlight - */ - public function returnsHighlightIfSet($highlight): void - { - $result = DateDemand::createFromRequestValues( - [ - 'highlight' => $highlight, - ], - [ - ] - ); - - self::assertTrue($result->getHighlight()); - } - - public 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 - { - $result = DateDemand::createFromRequestValues( - [ - 'highlight' => $highlight, - ], - [ - ] - ); - - self::assertFalse($result->getHighlight()); - } - - public function possibleSubmittedFalsyHighlights(): \Generator - { - yield 'false' => ['highlight' => false]; - yield '0 as integer' => ['highlight' => 0]; - yield '0 as string' => ['highlight' => '0']; - yield 'empty string' => ['highlight' => '']; - } -} diff --git a/Tests/Unit/Domain/Model/Event/LocationDataTest.php b/Tests/Unit/Domain/Model/Event/LocationDataTest.php deleted file mode 100644 index bde4035..0000000 --- a/Tests/Unit/Domain/Model/Event/LocationDataTest.php +++ /dev/null @@ -1,366 +0,0 @@ -_setProperty('name', 'Location Name'); - - self::assertSame( - 'Location Name', - $subject->getName() - ); - } - - /** - * @test - */ - public function returnsLocationStreetFromLegacyProperty(): void - { - $subject = new Event(); - $subject->_setProperty('street', 'Mußterstraße 24'); - - self::assertSame( - 'Mußterstraße 24', - $subject->getStreet() - ); - } - - /** - * @test - */ - public function returnsLocationDistrictFromLegacyProperty(): void - { - $subject = new Event(); - $subject->_setProperty('district', 'NRW'); - - self::assertSame( - 'NRW', - $subject->getDistrict() - ); - } - - /** - * @test - */ - public function returnsLocationCityFromLegacyProperty(): void - { - $subject = new Event(); - $subject->_setProperty('city', 'Weimar'); - - self::assertSame( - 'Weimar', - $subject->getCity() - ); - } - - /** - * @test - */ - public function returnsLocationZipFromLegacyProperty(): void - { - $subject = new Event(); - $subject->_setProperty('zip', '41367'); - - self::assertSame( - '41367', - $subject->getZip() - ); - } - - /** - * @test - */ - public function returnsLocationCountryFromLegacyProperty(): void - { - $subject = new Event(); - $subject->_setProperty('country', 'Germany'); - - self::assertSame( - 'Germany', - $subject->getCountry() - ); - } - - /** - * @test - */ - public function returnsLocationPhoneFromLegacyProperty(): void - { - $subject = new Event(); - $subject->_setProperty('phone', '+49 2161 333 333 333'); - - self::assertSame( - '+49 2161 333 333 333', - $subject->getPhone() - ); - } - - /** - * @test - */ - public function returnsLocationLatitudeFromLegacyProperty(): void - { - $subject = new Event(); - $subject->_setProperty('latitude', '50.720971023259'); - - self::assertSame( - '50.720971023259', - $subject->getLatitude() - ); - } - - /** - * @test - */ - public function returnsLocationLongitudeFromLegacyProperty(): void - { - $subject = new Event(); - $subject->_setProperty('longitude', '11.335229873657'); - - self::assertSame( - '11.335229873657', - $subject->getLongitude() - ); - } - - /** - * @test - */ - public function returnsLocationNameFromLocation(): void - { - $subject = new Event(); - $subject->setLocation(new Location( - 'Location Name', - '', - '', - '', - '', - '', - '', - '', - '', - -1 - )); - - self::assertSame( - 'Location Name', - $subject->getName() - ); - } - - /** - * @test - */ - public function returnsLocationStreetFromLocation(): void - { - $subject = new Event(); - $subject->setLocation(new Location( - '', - 'Mußterstraße 24', - '', - '', - '', - '', - '', - '', - '', - -1 - )); - - self::assertSame( - 'Mußterstraße 24', - $subject->getStreet() - ); - } - - /** - * @test - */ - public function returnsLocationDistrictFromLocation(): void - { - $subject = new Event(); - $subject->setLocation(new Location( - '', - '', - '', - '', - 'NRW', - '', - '', - '', - '', - -1 - )); - - self::assertSame( - 'NRW', - $subject->getDistrict() - ); - } - - /** - * @test - */ - public function returnsLocationCityFromLocation(): void - { - $subject = new Event(); - $subject->setLocation(new Location( - '', - '', - '', - 'Weimar', - '', - '', - '', - '', - '', - -1 - )); - - self::assertSame( - 'Weimar', - $subject->getCity() - ); - } - - /** - * @test - */ - public function returnsLocationZipFromLocation(): void - { - $subject = new Event(); - $subject->setLocation(new Location( - '', - '', - '41367', - '', - '', - '', - '', - '', - '', - -1 - )); - - self::assertSame( - '41367', - $subject->getZip() - ); - } - - /** - * @test - */ - public function returnsLocationCountryFromLocation(): void - { - $subject = new Event(); - $subject->setLocation(new Location( - '', - '', - '', - '', - '', - 'Germany', - '', - '', - '', - -1 - )); - - self::assertSame( - 'Germany', - $subject->getCountry() - ); - } - - /** - * @test - */ - public function returnsLocationPhoneFromLocation(): void - { - $subject = new Event(); - $subject->setLocation(new Location( - '', - '', - '', - '', - '', - '', - '+49 2161 333 333 333', - '', - '', - -1 - )); - - self::assertSame( - '+49 2161 333 333 333', - $subject->getPhone() - ); - } - - /** - * @test - */ - public function returnsLocationLatitudeFromLocation(): void - { - $subject = new Event(); - $subject->setLocation(new Location( - '', - '', - '', - '', - '', - '', - '', - '50.720971023259', - '', - -1 - )); - - self::assertSame( - '50.720971023259', - $subject->getLatitude() - ); - } - - /** - * @test - */ - public function returnsLocationLongitudeFromLocation(): void - { - $subject = new Event(); - $subject->setLocation(new Location( - '', - '', - '', - '', - '', - '', - '', - '', - '11.335229873657', - -1 - )); - - self::assertSame( - '11.335229873657', - $subject->getLongitude() - ); - } -} diff --git a/ext_tables.sql b/ext_tables.sql index 0c3a34b..fff8dd3 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -11,20 +11,11 @@ CREATE TABLE tx_events_domain_model_event ( teaser text, details text, price_info text, - name varchar(255) DEFAULT '' NOT NULL, - street varchar(255) DEFAULT '' NOT NULL, - district varchar(255) DEFAULT '' NOT NULL, - city varchar(255) DEFAULT '' NOT NULL, - zip varchar(255) DEFAULT '' NOT NULL, - country varchar(255) DEFAULT '' NOT NULL, web varchar(255) DEFAULT '' NOT NULL, - phone varchar(255) DEFAULT '' NOT NULL, ticket text, facebook varchar(255) DEFAULT '' NOT NULL, youtube varchar(255) DEFAULT '' NOT NULL, instagram varchar(255) DEFAULT '' NOT NULL, - latitude varchar(255) DEFAULT '' NOT NULL, - longitude varchar(255) DEFAULT '' NOT NULL, images int(11) unsigned NOT NULL default '0', categories int(11) DEFAULT '0' NOT NULL, features int(11) DEFAULT '0' NOT NULL, diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1df3fc1..ce19eb3 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -13,11 +13,6 @@ parameters: count: 1 path: Classes/Domain/DestinationData/ImportFactory.php - - - message: "#^Parameter \\#1 \\$min \\(999\\) of function random_int expects lower number than parameter \\#2 \\$max \\(int\\<1, max\\>\\)\\.$#" - count: 1 - path: Classes/Domain/DestinationData/LegacyImportFactory.php - - message: "#^Call to method deleteFile\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Resource\\\\Storage\\.$#" count: 1