mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-22 12:16:10 +01:00
Migrate TypoScript import settings
Those are now part of the import, or hard coded. Resolves: #11483
This commit is contained in:
parent
578751d156
commit
a07c16b723
51 changed files with 260 additions and 468 deletions
|
@ -21,13 +21,17 @@ class Import extends AbstractDomainObject
|
|||
public function __construct(
|
||||
protected Folder $filesFolder,
|
||||
protected int $storagePid,
|
||||
protected string $restLicenseKey,
|
||||
protected string $restExperience,
|
||||
protected string $restMode = 'next_months,12',
|
||||
protected int $restLimit = 500,
|
||||
protected string $restSearchQuery = '',
|
||||
int $categoriesPid = 0,
|
||||
protected ?Category $categoryParent = null,
|
||||
int $featuresPid = 0,
|
||||
protected ?Category $featuresParent = null,
|
||||
protected ?Region $region = null,
|
||||
protected string $importRepeatUntil = '+60 days',
|
||||
protected int $importFeatures = 0,
|
||||
) {
|
||||
// Do not allow categories on pid 0
|
||||
|
@ -78,18 +82,38 @@ class Import extends AbstractDomainObject
|
|||
return $this->region;
|
||||
}
|
||||
|
||||
public function getFeatures(): Features
|
||||
{
|
||||
return new Features($this->importFeatures);
|
||||
}
|
||||
|
||||
public function getRepeatUntil(): string
|
||||
{
|
||||
return $this->importRepeatUntil;
|
||||
}
|
||||
|
||||
public function getRestLicenseKey(): string
|
||||
{
|
||||
return $this->restLicenseKey;
|
||||
}
|
||||
|
||||
public function getRestExperience(): string
|
||||
{
|
||||
return $this->restExperience;
|
||||
}
|
||||
|
||||
public function getSearchQuery(): string
|
||||
public function getRestMode(): string
|
||||
{
|
||||
return $this->restMode;
|
||||
}
|
||||
|
||||
public function getRestLimit(): int
|
||||
{
|
||||
return (int)$this->restLimit;
|
||||
}
|
||||
|
||||
public function getRestSearchQuery(): string
|
||||
{
|
||||
return $this->restSearchQuery;
|
||||
}
|
||||
|
||||
public function getFeatures(): Features
|
||||
{
|
||||
return new Features($this->importFeatures);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -254,7 +254,7 @@ final class DestinationDataImportService
|
|||
$this->dateRepository->remove($currentDate);
|
||||
}
|
||||
|
||||
$dates = $this->datesFactory->createDates($timeIntervals, $canceled);
|
||||
$dates = $this->datesFactory->createDates($this->import, $timeIntervals, $canceled);
|
||||
foreach ($dates as $date) {
|
||||
$this->tmpCurrentEvent->addDate($date);
|
||||
}
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace WerkraumMedia\Events\Service\DestinationDataImportService;
|
||||
|
||||
final class ArrayBasedConfigurationService implements ConfigurationServiceInterface
|
||||
{
|
||||
public function __construct(
|
||||
private readonly array $settings
|
||||
) {
|
||||
}
|
||||
|
||||
public function getLicenseKey(): string
|
||||
{
|
||||
return $this->settings['license'] ?? '';
|
||||
}
|
||||
|
||||
public function getRestType(): string
|
||||
{
|
||||
return $this->settings['restType'] ?? '';
|
||||
}
|
||||
|
||||
public function getRestMode(): string
|
||||
{
|
||||
return $this->settings['restMode'] ?? '';
|
||||
}
|
||||
|
||||
public function getRestLimit(): string
|
||||
{
|
||||
return $this->settings['restLimit'] ?? '';
|
||||
}
|
||||
|
||||
public function getRestTemplate(): string
|
||||
{
|
||||
return $this->settings['restTemplate'] ?? '';
|
||||
}
|
||||
|
||||
public function getRestUrl(): string
|
||||
{
|
||||
return $this->settings['restUrl'] ?? '';
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace WerkraumMedia\Events\Service\DestinationDataImportService;
|
||||
|
||||
interface ConfigurationServiceInterface
|
||||
{
|
||||
public function getLicenseKey(): string;
|
||||
public function getRestType(): string;
|
||||
public function getRestMode(): string;
|
||||
public function getRestLimit(): string;
|
||||
public function getRestTemplate(): string;
|
||||
public function getRestUrl(): string;
|
||||
}
|
|
@ -12,8 +12,8 @@ use Generator;
|
|||
use Psr\Log\LoggerInterface;
|
||||
use TYPO3\CMS\Core\Context\Context;
|
||||
use TYPO3\CMS\Core\Log\LogManager;
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
|
||||
use WerkraumMedia\Events\Domain\Model\Date;
|
||||
use WerkraumMedia\Events\Domain\Model\Import;
|
||||
|
||||
final class DatesFactory
|
||||
{
|
||||
|
@ -21,7 +21,6 @@ final class DatesFactory
|
|||
|
||||
public function __construct(
|
||||
private readonly Context $context,
|
||||
private readonly ConfigurationManager $configurationManager,
|
||||
LogManager $logManager
|
||||
) {
|
||||
$this->logger = $logManager->getLogger(self::class);
|
||||
|
@ -31,11 +30,12 @@ final class DatesFactory
|
|||
* @return Generator<Date>
|
||||
*/
|
||||
public function createDates(
|
||||
Import $import,
|
||||
array $timeIntervals,
|
||||
bool $canceled
|
||||
): Generator {
|
||||
foreach ($timeIntervals as $date) {
|
||||
$dates = $this->createDate($date, $canceled);
|
||||
$dates = $this->createDate($import, $date, $canceled);
|
||||
if (!$dates instanceof Generator) {
|
||||
return null;
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ final class DatesFactory
|
|||
* @return Generator<Date>|null
|
||||
*/
|
||||
private function createDate(
|
||||
Import $import,
|
||||
array $date,
|
||||
bool $canceled
|
||||
): ?Generator {
|
||||
|
@ -60,7 +61,7 @@ final class DatesFactory
|
|||
|
||||
if ($this->isDateInterval($date)) {
|
||||
$this->logger->info('Is interval date', ['date' => $date]);
|
||||
return $this->createDateFromInterval($date, $canceled);
|
||||
return $this->createDateFromInterval($import, $date, $canceled);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -106,10 +107,11 @@ final class DatesFactory
|
|||
* @return Generator<Date>|null
|
||||
*/
|
||||
private function createDateFromInterval(
|
||||
Import $import,
|
||||
array $date,
|
||||
bool $canceled
|
||||
): ?Generator {
|
||||
$date = $this->ensureRepeatUntil($date);
|
||||
$date = $this->ensureRepeatUntil($import, $date);
|
||||
|
||||
if ($date['freq'] == 'Daily') {
|
||||
return $this->createDailyDates($date, $canceled);
|
||||
|
@ -122,19 +124,15 @@ final class DatesFactory
|
|||
return null;
|
||||
}
|
||||
|
||||
private function ensureRepeatUntil(array $date): array
|
||||
{
|
||||
private function ensureRepeatUntil(
|
||||
Import $import,
|
||||
array $date
|
||||
): array {
|
||||
if (empty($date['repeatUntil']) === false) {
|
||||
return $date;
|
||||
}
|
||||
|
||||
$settings = $this->configurationManager->getConfiguration(
|
||||
ConfigurationManager::CONFIGURATION_TYPE_SETTINGS,
|
||||
'Events',
|
||||
'Import'
|
||||
);
|
||||
$configuredModification = $settings['repeatUntil'] ?? '+60 days';
|
||||
$date['repeatUntil'] = $this->getToday()->modify($configuredModification)->format('c');
|
||||
$date['repeatUntil'] = $this->getToday()->modify($import->getRepeatUntil())->format('c');
|
||||
$this->logger->info('Interval did not provide repeatUntil.', ['newRepeat' => $date['repeatUntil']]);
|
||||
|
||||
return $date;
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace WerkraumMedia\Events\Service\DestinationDataImportService;
|
||||
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
|
||||
use WerkraumMedia\Events\Service\ExtbaseConfigurationManagerService;
|
||||
|
||||
final class ExtbaseConfigurationService implements ConfigurationServiceInterface
|
||||
{
|
||||
private array $settings = [];
|
||||
|
||||
public function __construct(
|
||||
private ExtbaseConfigurationManagerService $configurationManager
|
||||
) {
|
||||
}
|
||||
|
||||
public function getLicenseKey(): string
|
||||
{
|
||||
return $this->getSettings()['license'] ?? '';
|
||||
}
|
||||
|
||||
public function getRestType(): string
|
||||
{
|
||||
return $this->getSettings()['restType'] ?? '';
|
||||
}
|
||||
|
||||
public function getRestMode(): string
|
||||
{
|
||||
return $this->getSettings()['restMode'] ?? '';
|
||||
}
|
||||
|
||||
public function getRestLimit(): string
|
||||
{
|
||||
return $this->getSettings()['restLimit'] ?? '';
|
||||
}
|
||||
|
||||
public function getRestTemplate(): string
|
||||
{
|
||||
return $this->getSettings()['restTemplate'] ?? '';
|
||||
}
|
||||
|
||||
public function getRestUrl(): string
|
||||
{
|
||||
return $this->getSettings()['restUrl'] ?? '';
|
||||
}
|
||||
|
||||
private function getSettings(): array
|
||||
{
|
||||
if ($this->settings !== []) {
|
||||
return $this->settings;
|
||||
}
|
||||
|
||||
$fullTypoScript = $this->configurationManager
|
||||
->getInstanceWithBackendContext()
|
||||
->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT)
|
||||
;
|
||||
|
||||
$this->settings = $fullTypoScript['module.']['tx_events.']['settings.']['destinationData.']
|
||||
?? $fullTypoScript['module.']['tx_events_pi1.']['settings.']['destinationData.']
|
||||
?? [];
|
||||
|
||||
return $this->settings;
|
||||
}
|
||||
}
|
|
@ -12,11 +12,6 @@ use WerkraumMedia\Events\Domain\Model\Import;
|
|||
*/
|
||||
final class UrlFactory
|
||||
{
|
||||
public function __construct(
|
||||
private readonly ConfigurationServiceInterface $configuration,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* URL used to fetch initial set of data.
|
||||
*/
|
||||
|
@ -25,17 +20,17 @@ final class UrlFactory
|
|||
): string {
|
||||
$parameter = [
|
||||
'experience' => $import->getRestExperience(),
|
||||
'licensekey' => $this->configuration->getLicenseKey(),
|
||||
'type' => $this->configuration->getRestType(),
|
||||
'mode' => $this->configuration->getRestMode(),
|
||||
'limit' => $this->configuration->getRestLimit(),
|
||||
'template' => $this->configuration->getRestTemplate(),
|
||||
'q' => $import->getSearchQuery(),
|
||||
'licensekey' => $import->getRestLicenseKey(),
|
||||
'type' => 'Event',
|
||||
'mode' => $import->getRestMode(),
|
||||
'limit' => $import->getRestLimit(),
|
||||
'template' => 'ET2014A.json',
|
||||
'q' => $import->getRestSearchQuery(),
|
||||
];
|
||||
|
||||
$parameter = array_filter($parameter);
|
||||
|
||||
$url = new Uri($this->configuration->getRestUrl());
|
||||
$url = new Uri('http://meta.et4.de/rest.ashx/search/');
|
||||
$url = $url->withQuery(http_build_query($parameter));
|
||||
return (string)$url;
|
||||
}
|
||||
|
|
|
@ -43,9 +43,6 @@ services:
|
|||
WerkraumMedia\Events\Updates\MigrateOldLocations:
|
||||
public: true
|
||||
|
||||
WerkraumMedia\Events\Service\DestinationDataImportService\ConfigurationServiceInterface:
|
||||
alias: 'WerkraumMedia\Events\Service\DestinationDataImportService\ExtbaseConfigurationService'
|
||||
|
||||
WerkraumMedia\Events\Caching\PageCacheTimeout:
|
||||
arguments:
|
||||
'$runtimeCache': '@cache.runtime'
|
||||
|
|
|
@ -28,9 +28,13 @@ return [
|
|||
'--palette--;;features',
|
||||
'--palette--;;relations',
|
||||
'--div--;LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.div.rest',
|
||||
'rest_license_key',
|
||||
'rest_experience',
|
||||
'rest_mode',
|
||||
'rest_limit',
|
||||
'rest_search_query',
|
||||
'--div--;LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.div.import',
|
||||
'import_repeat_until',
|
||||
'import_features',
|
||||
]),
|
||||
],
|
||||
|
@ -162,16 +166,53 @@ return [
|
|||
],
|
||||
],
|
||||
|
||||
'rest_license_key' => [
|
||||
'exclude' => true,
|
||||
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.rest_license_key',
|
||||
'description' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.rest_license_key.description',
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => 50,
|
||||
],
|
||||
],
|
||||
'rest_experience' => [
|
||||
'exclude' => true,
|
||||
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.rest_experience',
|
||||
'description' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.rest_experience.description',
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'required' => true,
|
||||
'size' => 50,
|
||||
'max' => 255,
|
||||
],
|
||||
],
|
||||
'rest_mode' => [
|
||||
'exclude' => true,
|
||||
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.rest_mode',
|
||||
'description' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.rest_mode.description',
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'default' => 'next_months,12',
|
||||
'size' => 50,
|
||||
'max' => 255,
|
||||
],
|
||||
],
|
||||
'rest_limit' => [
|
||||
'exclude' => true,
|
||||
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.rest_limit',
|
||||
'description' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.rest_limit.description',
|
||||
'config' => [
|
||||
'type' => 'number',
|
||||
'format' => 'integer',
|
||||
'default' => '500',
|
||||
'size' => 50,
|
||||
'required' => true,
|
||||
'range' => [
|
||||
'lower' => 0,
|
||||
'upper' => 5000,
|
||||
],
|
||||
],
|
||||
],
|
||||
'rest_search_query' => [
|
||||
'exclude' => true,
|
||||
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.rest_search_query',
|
||||
|
@ -181,6 +222,18 @@ return [
|
|||
'size' => 50,
|
||||
],
|
||||
],
|
||||
|
||||
'import_repeat_until' => [
|
||||
'exclude' => true,
|
||||
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.import_repeat_until',
|
||||
'description' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.import_repeat_until.description',
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'default' => '+60 days',
|
||||
'size' => 50,
|
||||
'max' => 255,
|
||||
],
|
||||
],
|
||||
'import_features' => [
|
||||
'exclude' => true,
|
||||
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_import.xlf:tx_events_domain_model_import.import_features',
|
||||
|
|
|
@ -15,23 +15,5 @@ plugin.tx_events {
|
|||
settings {
|
||||
# cat=plugin.tx_events//a; type=string; label=Default Image
|
||||
defaultImagePath = EXT:events/Resources/Public/Images/default.jpg
|
||||
destinationData {
|
||||
# cat=plugin.tx_events//a; type=string; label=Rest Url
|
||||
restUrl = http://meta.et4.de/rest.ashx/search/
|
||||
# cat=plugin.tx_events//a; type=string; label=License
|
||||
license =
|
||||
# cat=plugin.tx_events//a; type=string; label=Data Type
|
||||
restType = Event
|
||||
# cat=plugin.tx_events//a; type=string; label=Data Limit
|
||||
restLimit = 500
|
||||
# cat=plugin.tx_events//a; type=string; label=Mode
|
||||
restMode = next_months,12
|
||||
# cat=plugin.tx_events//a; type=string; label=Data Template
|
||||
restTemplate = ET2014A.json
|
||||
# cat=plugin.tx_events//a; type=string; Label=Category Storage
|
||||
categoriesPid = 54
|
||||
# cat=plugin.tx_events//a; type=string; Label=Category Parent ID
|
||||
categoryParentUid = 6
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,17 +42,6 @@ plugin.tx_events {
|
|||
maximumNumberOfLinks = 10
|
||||
}
|
||||
|
||||
destinationData {
|
||||
restUrl = {$plugin.tx_events.settings.destinationData.restUrl}
|
||||
license = {$plugin.tx_events.settings.destinationData.license}
|
||||
restType = {$plugin.tx_events.settings.destinationData.restType}
|
||||
restLimit = {$plugin.tx_events.settings.destinationData.restLimit}
|
||||
restMode = {$plugin.tx_events.settings.destinationData.restMode}
|
||||
restTemplate = {$plugin.tx_events.settings.destinationData.restTemplate}
|
||||
categoriesPid = {$plugin.tx_events.settings.destinationData.categoriesPid}
|
||||
categoryParentUid = {$plugin.tx_events.settings.destinationData.categoryParentUid}
|
||||
}
|
||||
|
||||
dataProcessing {
|
||||
WerkraumMedia\Events\Domain\Model\Event {
|
||||
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
|
||||
|
|
|
@ -14,12 +14,23 @@ Breaking
|
|||
We recommend not to use the provided plugins but build your own tailored content
|
||||
elements instead.
|
||||
|
||||
* Remaining TypoScript constants for import were moved.
|
||||
|
||||
Those are now part of the import configuration record.
|
||||
The previous default values will be inserted.
|
||||
Make sure to update the existing records to include the necessary values.
|
||||
|
||||
Some value are now hard coded as we do not support other values anyway.
|
||||
|
||||
This also affects the `repeatUntil` TypoScript setting which is now moved to the import configuration.
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
* Add Support for TYPO3 v13.4 LTS.
|
||||
|
||||
* Support large rest search queries.
|
||||
|
||||
The field no longer has a limitation.
|
||||
The field is now stored as text instead of varchar.
|
||||
|
||||
|
|
|
@ -72,17 +72,41 @@
|
|||
<trans-unit id="tx_events_domain_model_import.files_folder.description">
|
||||
<source>TYPO3 folder to use for storing imported files.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_import.rest_license_key">
|
||||
<source>License Key</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_import.rest_license_key.description">
|
||||
<source>See: https://developer.et4.de/reference/current/#eT4META-search-param-licensekey.html</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_import.rest_experience">
|
||||
<source>Experience</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_import.rest_experience.description">
|
||||
<source>See: https://developer.et4.de/reference/current/#eT4META-search-param-experience.html (todo check, was not loadable)</source>
|
||||
<source>See: https://developer.et4.de/reference/current/#eT4META-search-param-experience.html</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_import.rest_mode">
|
||||
<source>Mode</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_import.rest_mode.description">
|
||||
<source>See: https://developer.et4.de/reference/current/#eT4META-search-param-mode.html</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_import.rest_limit">
|
||||
<source>Limit</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_import.rest_limit.description">
|
||||
<source>See: https://developer.et4.de/reference/current/#eT4META-search-param-limit.html</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_import.rest_search_query">
|
||||
<source>Search Query</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_import.rest_search_query.description">
|
||||
<source>See: https://developer.et4.de/reference/current/#eT4META-search-param-q.html (todo check, was not loadable)</source>
|
||||
<source>See: https://developer.et4.de/reference/current/#eT4META-search-param-q.html</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_import.import_repeat_until">
|
||||
<source>Repeat events until</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_import.import_repeat_until.description">
|
||||
<source>Some events will repeat. This will define how many dates will be created. See: https://www.php.net/manual/en/datetimeimmutable.modify.php</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_import.import_features">
|
||||
<source>Import Features</source>
|
||||
|
|
|
@ -114,22 +114,6 @@ abstract class AbstractFunctionalTestCase extends FunctionalTestCase
|
|||
return new TypoScriptInstruction();
|
||||
}
|
||||
|
||||
protected function setUpConfiguration(
|
||||
array $destinationDataSettings,
|
||||
array $importSettings = []
|
||||
): void {
|
||||
$this->setUpFrontendRootPage(1, [], [
|
||||
'config' => implode(PHP_EOL, [
|
||||
'module.tx_events_pi1.settings.destinationData {',
|
||||
implode(PHP_EOL, $destinationDataSettings),
|
||||
'}',
|
||||
'module.tx_events_import.settings {',
|
||||
implode(PHP_EOL, $importSettings),
|
||||
'}',
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
protected function &setUpResponses(array $responses): array
|
||||
{
|
||||
$requests = [];
|
||||
|
|
|
@ -269,14 +269,6 @@ class CacheTest extends AbstractFunctionalTestCase
|
|||
|
||||
// Import
|
||||
$this->importPHPDataSet(__DIR__ . '/../Import/DestinationDataTest/Fixtures/Database/DefaultImportConfiguration.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
$this->setUpResponses([
|
||||
new Response(200, [], file_get_contents(__DIR__ . '/../Import/DestinationDataTest/Fixtures/ResponseWithSingleImageForSingleEvent.json') ?: ''),
|
||||
new Response(200, [], file_get_contents(__DIR__ . '/../Import/DestinationDataTest/Fixtures/ExampleImage.jpg') ?: ''),
|
||||
|
|
|
@ -12,6 +12,9 @@ return [
|
|||
'files_folder' => '1:/staedte/beispielstadt/events/',
|
||||
'region' => '1',
|
||||
'rest_experience' => 'beispielstadt',
|
||||
'rest_license_key' => 'example-license',
|
||||
'rest_limit' => '3',
|
||||
'rest_mode' => 'next_months,12',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
@ -12,6 +12,10 @@ return [
|
|||
'features_pid' => '3',
|
||||
'features_parent' => '4',
|
||||
'files_folder' => '1:/staedte/beispielstadt/events/',
|
||||
'rest_experience' => 'beispielstadt',
|
||||
'rest_license_key' => 'example-license',
|
||||
'rest_limit' => '3',
|
||||
'rest_mode' => 'next_months,12',
|
||||
],
|
||||
],
|
||||
'pages' => [
|
||||
|
|
|
@ -10,6 +10,10 @@ return [
|
|||
'title' => 'Example for test',
|
||||
'storage_pid' => '2',
|
||||
'files_folder' => '1:/staedte/beispielstadt/events/',
|
||||
'rest_experience' => 'beispielstadt',
|
||||
'rest_license_key' => 'example-license',
|
||||
'rest_limit' => '3',
|
||||
'rest_mode' => 'next_months,12',
|
||||
],
|
||||
],
|
||||
'pages' => [
|
||||
|
|
|
@ -12,6 +12,9 @@ return [
|
|||
'files_folder' => '1:/staedte/beispielstadt/events/',
|
||||
'region' => '1',
|
||||
'rest_experience' => 'beispielstadt',
|
||||
'rest_license_key' => 'example-license',
|
||||
'rest_limit' => '3',
|
||||
'rest_mode' => 'next_months,12',
|
||||
'import_features' => '1',
|
||||
],
|
||||
],
|
||||
|
|
|
@ -10,6 +10,9 @@ return [
|
|||
'title' => 'Example import configuration',
|
||||
'storage_pid' => '2',
|
||||
'rest_experience' => 'beispielstadt',
|
||||
'rest_license_key' => 'example-license',
|
||||
'rest_limit' => '3',
|
||||
'rest_mode' => 'next_months,12',
|
||||
'files_folder' => '1:/staedte/beispielstadt/events/',
|
||||
],
|
||||
],
|
||||
|
|
|
@ -14,6 +14,9 @@ return [
|
|||
'category_parent' => '2',
|
||||
'region' => '1',
|
||||
'rest_experience' => 'anderestadt',
|
||||
'rest_license_key' => 'example-license',
|
||||
'rest_limit' => '3',
|
||||
'rest_mode' => 'next_months,12',
|
||||
'rest_search_query' => 'name:"Beispiel2"',
|
||||
],
|
||||
],
|
||||
|
|
|
@ -14,6 +14,9 @@ return [
|
|||
'category_parent' => '2',
|
||||
'region' => '1',
|
||||
'rest_experience' => 'beispielstadt',
|
||||
'rest_license_key' => 'example-license',
|
||||
'rest_limit' => '3',
|
||||
'rest_mode' => 'next_months,12',
|
||||
'rest_search_query' => 'name:"Beispiel"',
|
||||
],
|
||||
],
|
||||
|
|
|
@ -14,6 +14,9 @@ return [
|
|||
'category_parent' => '2',
|
||||
'region' => '1',
|
||||
'rest_experience' => 'beispielstadt',
|
||||
'rest_license_key' => 'example-license',
|
||||
'rest_limit' => '3',
|
||||
'rest_mode' => 'next_months,12',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
@ -11,6 +11,9 @@ return [
|
|||
'storage_pid' => '2',
|
||||
'files_folder' => '1:/staedte/beispielstadt/events/',
|
||||
'rest_experience' => 'beispielstadt',
|
||||
'rest_license_key' => 'example-license',
|
||||
'rest_limit' => '3',
|
||||
'rest_mode' => 'next_months,12',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
@ -17,14 +17,6 @@ class ImportCleansTransientFilesTest extends AbstractTestCase
|
|||
public function cleansTransientFiles(): void
|
||||
{
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
|
||||
$requests = &$this->setUpResponses([
|
||||
new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/Response.json') ?: ''),
|
||||
|
@ -38,7 +30,7 @@ class ImportCleansTransientFilesTest extends AbstractTestCase
|
|||
self::assertSame(0, $tester->getStatusCode());
|
||||
|
||||
self::assertCount(4, $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());
|
||||
self::assertSame('http://meta.et4.de/rest.ashx/search/?experience=beispielstadt&licensekey=example-license&type=Event&mode=next_months%2C12&limit=3&template=ET2014A.json', (string)$requests[0]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', (string)$requests[1]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg', (string)$requests[2]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/853436/109ac1cf87913e21b5e2b0ef0cc63d223a14374364952a855746a8e7c3fcfc36/lutherkirche-jpg.jpg', (string)$requests[3]['request']->getUri());
|
||||
|
|
|
@ -17,14 +17,6 @@ class ImportDoesNotUseUploadsFolderTest extends AbstractTestCase
|
|||
public function doesNotUseUploadsFolder(): void
|
||||
{
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
|
||||
$requests = &$this->setUpResponses([
|
||||
new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/Response.json') ?: ''),
|
||||
|
@ -37,7 +29,7 @@ class ImportDoesNotUseUploadsFolderTest extends AbstractTestCase
|
|||
self::assertSame(0, $tester->getStatusCode());
|
||||
|
||||
self::assertCount(4, $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());
|
||||
self::assertSame('http://meta.et4.de/rest.ashx/search/?experience=beispielstadt&licensekey=example-license&type=Event&mode=next_months%2C12&limit=3&template=ET2014A.json', (string)$requests[0]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', (string)$requests[1]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg', (string)$requests[2]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/853436/109ac1cf87913e21b5e2b0ef0cc63d223a14374364952a855746a8e7c3fcfc36/lutherkirche-jpg.jpg', (string)$requests[3]['request']->getUri());
|
||||
|
|
|
@ -15,14 +15,6 @@ class ImportDoesntBreakWithLongFileTitleTest extends AbstractTestCase
|
|||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleImportConfigurationWithCategories.php');
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleRegion.php');
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleCategory.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
|
||||
$requests = &$this->setUpResponses([
|
||||
new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithVeryLongFileName.json') ?: ''),
|
||||
|
|
|
@ -17,14 +17,6 @@ class ImportDoesntEndUpInEndlessDateCreationTest extends AbstractTestCase
|
|||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php');
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleRegion.php');
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleCategory.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
|
||||
$requests = &$this->setUpResponses([
|
||||
new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithPotentiellyEndlessDateCreation.json') ?: ''),
|
||||
|
|
|
@ -21,14 +21,6 @@ class ImportHandlesImagesTest extends AbstractTestCase
|
|||
parent::setUp();
|
||||
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
|
|
|
@ -17,14 +17,6 @@ class ImportHandlesPricesTest extends AbstractTestCase
|
|||
parent::setUp();
|
||||
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
|
|
|
@ -28,14 +28,6 @@ class ImportsAllConfigurationTest extends AbstractTestCase
|
|||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleCategory.php');
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleImportConfiguration.php');
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SecondImportConfiguration.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restTemplate = ET2014A.json',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
]);
|
||||
|
||||
$requests = &$this->setUpResponses([
|
||||
new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/Response.json') ?: ''),
|
||||
|
@ -54,12 +46,12 @@ class ImportsAllConfigurationTest extends AbstractTestCase
|
|||
self::assertSame(0, $tester->getStatusCode());
|
||||
|
||||
self::assertCount(8, $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&q=name%3A%22Beispiel%22', (string)$requests[0]['request']->getUri());
|
||||
self::assertSame('http://meta.et4.de/rest.ashx/search/?experience=beispielstadt&licensekey=example-license&type=Event&mode=next_months%2C12&limit=3&template=ET2014A.json&q=name%3A%22Beispiel%22', (string)$requests[0]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', (string)$requests[1]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg', (string)$requests[2]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/853436/109ac1cf87913e21b5e2b0ef0cc63d223a14374364952a855746a8e7c3fcfc36/lutherkirche-jpg.jpg', (string)$requests[3]['request']->getUri());
|
||||
|
||||
self::assertSame('https://example.com/some-path/?experience=anderestadt&licensekey=example-license&type=Event&mode=next_months%2C12&limit=3&template=ET2014A.json&q=name%3A%22Beispiel2%22', (string)$requests[4]['request']->getUri());
|
||||
self::assertSame('http://meta.et4.de/rest.ashx/search/?experience=beispielstadt&licensekey=example-license&type=Event&mode=next_months%2C12&limit=3&template=ET2014A.json&q=name%3A%22Beispiel%22', (string)$requests[0]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', (string)$requests[5]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg', (string)$requests[6]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/853436/109ac1cf87913e21b5e2b0ef0cc63d223a14374364952a855746a8e7c3fcfc36/lutherkirche-jpg.jpg', (string)$requests[7]['request']->getUri());
|
||||
|
|
|
@ -14,20 +14,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|||
#[TestDox('DestinationData import')]
|
||||
class ImportsExampleAsExpectedTest extends AbstractTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function importsExampleAsExpected(): void
|
||||
{
|
||||
|
@ -49,7 +35,7 @@ class ImportsExampleAsExpectedTest extends AbstractTestCase
|
|||
self::assertSame(0, $tester->getStatusCode());
|
||||
|
||||
self::assertCount(4, $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());
|
||||
self::assertSame('http://meta.et4.de/rest.ashx/search/?experience=beispielstadt&licensekey=example-license&type=Event&mode=next_months%2C12&limit=3&template=ET2014A.json', (string)$requests[0]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', (string)$requests[1]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg', (string)$requests[2]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/853436/109ac1cf87913e21b5e2b0ef0cc63d223a14374364952a855746a8e7c3fcfc36/lutherkirche-jpg.jpg', (string)$requests[3]['request']->getUri());
|
||||
|
|
|
@ -14,9 +14,6 @@ class ImportsFeaturesTest extends AbstractTestCase
|
|||
#[Test]
|
||||
public function addsNewFeatures(): void
|
||||
{
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
]);
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/FeaturesImportConfiguration.php');
|
||||
$this->setUpResponses([
|
||||
new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithFeatures.json') ?: ''),
|
||||
|
@ -30,9 +27,6 @@ class ImportsFeaturesTest extends AbstractTestCase
|
|||
#[Test]
|
||||
public function addsNewFeaturesToExistingOnes(): void
|
||||
{
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
]);
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/FeaturesImportConfiguration.php');
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/ExistingFeatures.php');
|
||||
$this->setUpResponses([
|
||||
|
|
|
@ -17,9 +17,6 @@ class ImportsFirstDateOfDatesTest extends AbstractTestCase
|
|||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
]);
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/FirstDateOfRecurringDatesImportConfiguration.php');
|
||||
$this->setDateAspect(new DateTimeImmutable('2022-07-13', new DateTimeZone('UTC')));
|
||||
}
|
||||
|
|
|
@ -22,14 +22,6 @@ class ImportsSingleConfigurationTest extends AbstractTestCase
|
|||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleRegion.php');
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleCategory.php');
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleImportConfiguration.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restTemplate = ET2014A.json',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
]);
|
||||
|
||||
$requests = &$this->setUpResponses([
|
||||
new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/Response.json') ?: ''),
|
||||
|
@ -43,7 +35,7 @@ class ImportsSingleConfigurationTest extends AbstractTestCase
|
|||
self::assertSame(0, $tester->getStatusCode());
|
||||
|
||||
self::assertCount(4, $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&q=name%3A%22Beispiel%22', (string)$requests[0]['request']->getUri());
|
||||
self::assertSame('http://meta.et4.de/rest.ashx/search/?experience=beispielstadt&licensekey=example-license&type=Event&mode=next_months%2C12&limit=3&template=ET2014A.json&q=name%3A%22Beispiel%22', (string)$requests[0]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', (string)$requests[1]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg', (string)$requests[2]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/853436/109ac1cf87913e21b5e2b0ef0cc63d223a14374364952a855746a8e7c3fcfc36/lutherkirche-jpg.jpg', (string)$requests[3]['request']->getUri());
|
||||
|
|
|
@ -12,20 +12,6 @@ use PHPUnit\Framework\Attributes\TestDox;
|
|||
#[TestDox('DestinationData import')]
|
||||
class ImportsTextsTest extends AbstractTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
$this->assertEmptyLog();
|
||||
|
|
|
@ -21,14 +21,6 @@ class ImportsTicketsTest extends AbstractTestCase
|
|||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php');
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleRegion.php');
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleCategory.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
|
||||
$requests = &$this->setUpResponses([
|
||||
new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithTickets.json') ?: ''),
|
||||
|
@ -39,7 +31,7 @@ class ImportsTicketsTest extends AbstractTestCase
|
|||
self::assertSame(0, $tester->getStatusCode());
|
||||
|
||||
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());
|
||||
self::assertSame('http://meta.et4.de/rest.ashx/search/?experience=beispielstadt&licensekey=example-license&type=Event&mode=next_months%2C12&limit=3&template=ET2014A.json', (string)$requests[0]['request']->getUri());
|
||||
|
||||
$this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsTickets.php');
|
||||
|
||||
|
|
|
@ -24,11 +24,14 @@ class ImportsWithConfiguredRepeatUntilTest extends AbstractTestCase
|
|||
#[Test]
|
||||
public function recurringWeekly(): void
|
||||
{
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
], [
|
||||
'repeatUntil = +30 days',
|
||||
]);
|
||||
$this->getConnectionPool()
|
||||
->getConnectionForTable('tx_events_domain_model_import')
|
||||
->update(
|
||||
'tx_events_domain_model_import',
|
||||
['import_repeat_until' => '+30 days'],
|
||||
['uid' => '1']
|
||||
)
|
||||
;
|
||||
$this->setUpResponses([new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithRecurringWeeklyWithoutRepeatUntil.json') ?: '')]);
|
||||
|
||||
$this->executeCommand();
|
||||
|
@ -40,11 +43,14 @@ class ImportsWithConfiguredRepeatUntilTest extends AbstractTestCase
|
|||
#[Test]
|
||||
public function recurringDaily(): void
|
||||
{
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
], [
|
||||
'repeatUntil = +10 days',
|
||||
]);
|
||||
$this->getConnectionPool()
|
||||
->getConnectionForTable('tx_events_domain_model_import')
|
||||
->update(
|
||||
'tx_events_domain_model_import',
|
||||
['import_repeat_until' => '+10 days'],
|
||||
['uid' => '1']
|
||||
)
|
||||
;
|
||||
$this->setUpResponses([new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithRecurringDailyWithoutRepeatUntil.json') ?: '')]);
|
||||
|
||||
$this->executeCommand();
|
||||
|
|
|
@ -16,14 +16,6 @@ final class ImportsWithLocationsTest extends AbstractTestCase
|
|||
parent::setUp();
|
||||
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
|
|
|
@ -24,9 +24,6 @@ class ImportsWithSystemConfiguredTimeZoneTest extends AbstractTestCase
|
|||
|
||||
parent::setUp();
|
||||
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
]);
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php');
|
||||
$this->setDateAspect(new DateTimeImmutable('2022-07-13', new DateTimeZone('UTC')));
|
||||
}
|
||||
|
|
|
@ -17,14 +17,6 @@ class ImportsWithoutCategoryIfNotProvidedTest extends AbstractTestCase
|
|||
{
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php');
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleRegion.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
|
||||
$requests = &$this->setUpResponses([
|
||||
new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/Response.json') ?: ''),
|
||||
|
@ -37,12 +29,6 @@ class ImportsWithoutCategoryIfNotProvidedTest extends AbstractTestCase
|
|||
|
||||
self::assertSame(0, $tester->getStatusCode());
|
||||
|
||||
self::assertCount(4, $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());
|
||||
self::assertSame('https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', (string)$requests[1]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg', (string)$requests[2]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/853436/109ac1cf87913e21b5e2b0ef0cc63d223a14374364952a855746a8e7c3fcfc36/lutherkirche-jpg.jpg', (string)$requests[3]['request']->getUri());
|
||||
|
||||
self::assertCount(
|
||||
0,
|
||||
$this->getAllRecords('tx_events_domain_model_partner'),
|
||||
|
|
|
@ -15,14 +15,6 @@ class ImportsWithoutLocationTest extends AbstractTestCase
|
|||
public function importsWithoutLocationIfNotProvided(): void
|
||||
{
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleImportConfigurationWithoutRegion.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
|
||||
$requests = &$this->setUpResponses([
|
||||
new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithoutLocation.json') ?: ''),
|
||||
|
|
|
@ -17,14 +17,6 @@ class ImportsWithoutRegionIfNotProvidedTest extends AbstractTestCase
|
|||
{
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleImportConfigurationWithoutRegion.php');
|
||||
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SingleCategory.php');
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
|
||||
$requests = &$this->setUpResponses([
|
||||
new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/Response.json') ?: ''),
|
||||
|
@ -36,12 +28,6 @@ class ImportsWithoutRegionIfNotProvidedTest extends AbstractTestCase
|
|||
|
||||
self::assertSame(0, $tester->getStatusCode());
|
||||
|
||||
self::assertCount(4, $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());
|
||||
self::assertSame('https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', (string)$requests[1]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg', (string)$requests[2]['request']->getUri());
|
||||
self::assertSame('https://dam.destination.one/853436/109ac1cf87913e21b5e2b0ef0cc63d223a14374364952a855746a8e7c3fcfc36/lutherkirche-jpg.jpg', (string)$requests[3]['request']->getUri());
|
||||
|
||||
self::assertCount(
|
||||
0,
|
||||
$this->getAllRecords('tx_events_domain_model_partner'),
|
||||
|
|
|
@ -34,15 +34,6 @@ final class CategoriesAssignEventTest extends AbstractTestCase
|
|||
$this->testExtensionsToLoad[] = 'typo3conf/ext/events/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Extensions/custom_categories/';
|
||||
|
||||
parent::setUp();
|
||||
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
|
|
|
@ -34,15 +34,6 @@ final class EventImportEventTest extends AbstractTestCase
|
|||
$this->testExtensionsToLoad[] = 'typo3conf/ext/events/Tests/Functional/Psr14Events/DestinationDataImport/Fixtures/Extensions/custom_event';
|
||||
|
||||
parent::setUp();
|
||||
|
||||
$this->setUpConfiguration([
|
||||
'restUrl = https://example.com/some-path/',
|
||||
'license = example-license',
|
||||
'restType = Event',
|
||||
'restLimit = 3',
|
||||
'restMode = next_months,12',
|
||||
'restTemplate = ET2014A.json',
|
||||
]);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
|
|
|
@ -12,6 +12,9 @@ return [
|
|||
'files_folder' => '1:/staedte/beispielstadt/events/',
|
||||
'region' => '1',
|
||||
'rest_experience' => 'beispielstadt',
|
||||
'rest_license_key' => 'example-license',
|
||||
'rest_limit' => '3',
|
||||
'rest_mode' => 'next_months,12',
|
||||
'categories_pid' => 2,
|
||||
'category_parent' => 2,
|
||||
],
|
||||
|
|
|
@ -12,6 +12,9 @@ return [
|
|||
'files_folder' => '1:/staedte/beispielstadt/events/',
|
||||
'region' => '1',
|
||||
'rest_experience' => 'beispielstadt',
|
||||
'rest_license_key' => 'example-license',
|
||||
'rest_limit' => '3',
|
||||
'rest_mode' => 'next_months,12',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
@ -21,7 +21,8 @@ class ImportTest extends TestCase
|
|||
$subject = new Import(
|
||||
$folder,
|
||||
0,
|
||||
''
|
||||
'',
|
||||
'',
|
||||
);
|
||||
|
||||
self::assertInstanceOf(
|
||||
|
@ -38,7 +39,8 @@ class ImportTest extends TestCase
|
|||
$subject = new Import(
|
||||
$folder,
|
||||
0,
|
||||
'experience'
|
||||
'',
|
||||
'experience',
|
||||
);
|
||||
|
||||
self::assertSame(
|
||||
|
@ -55,7 +57,8 @@ class ImportTest extends TestCase
|
|||
$subject = new Import(
|
||||
$folder,
|
||||
20,
|
||||
''
|
||||
'',
|
||||
'',
|
||||
);
|
||||
|
||||
self::assertSame(
|
||||
|
@ -75,6 +78,9 @@ class ImportTest extends TestCase
|
|||
0,
|
||||
'',
|
||||
'',
|
||||
'next_months,12',
|
||||
500,
|
||||
'',
|
||||
0,
|
||||
null,
|
||||
0,
|
||||
|
@ -96,7 +102,8 @@ class ImportTest extends TestCase
|
|||
$subject = new Import(
|
||||
$folder,
|
||||
0,
|
||||
''
|
||||
'',
|
||||
'',
|
||||
);
|
||||
|
||||
self::assertSame(
|
||||
|
@ -115,6 +122,9 @@ class ImportTest extends TestCase
|
|||
0,
|
||||
'',
|
||||
'',
|
||||
'next_months,12',
|
||||
500,
|
||||
'',
|
||||
10
|
||||
);
|
||||
|
||||
|
@ -135,6 +145,9 @@ class ImportTest extends TestCase
|
|||
0,
|
||||
'',
|
||||
'',
|
||||
'next_months,12',
|
||||
500,
|
||||
'',
|
||||
0,
|
||||
$category
|
||||
);
|
||||
|
@ -155,6 +168,9 @@ class ImportTest extends TestCase
|
|||
0,
|
||||
'',
|
||||
'',
|
||||
'next_months,12',
|
||||
500,
|
||||
'',
|
||||
0,
|
||||
null,
|
||||
10
|
||||
|
@ -177,6 +193,9 @@ class ImportTest extends TestCase
|
|||
0,
|
||||
'',
|
||||
'',
|
||||
'next_months,12',
|
||||
500,
|
||||
'',
|
||||
0,
|
||||
null,
|
||||
0,
|
||||
|
@ -198,12 +217,15 @@ class ImportTest extends TestCase
|
|||
$folder,
|
||||
0,
|
||||
'',
|
||||
'',
|
||||
'next_months,12',
|
||||
500,
|
||||
'name:"Test"'
|
||||
);
|
||||
|
||||
self::assertSame(
|
||||
'name:"Test"',
|
||||
$subject->getSearchQuery()
|
||||
$subject->getRestSearchQuery()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ use TYPO3\CMS\Core\Context\Context;
|
|||
use TYPO3\CMS\Core\Context\DateTimeAspect;
|
||||
use TYPO3\CMS\Core\Log\Logger;
|
||||
use TYPO3\CMS\Core\Log\LogManager;
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
|
||||
use WerkraumMedia\Events\Domain\Model\Date;
|
||||
use WerkraumMedia\Events\Domain\Model\Import;
|
||||
use WerkraumMedia\Events\Service\DestinationDataImportService\DatesFactory;
|
||||
|
||||
class DatesFactoryTest extends TestCase
|
||||
|
@ -28,7 +28,6 @@ class DatesFactoryTest extends TestCase
|
|||
|
||||
return new DatesFactory(
|
||||
$this->createContext(new DateTimeImmutable($contextDate)),
|
||||
$this->createStub(ConfigurationManager::class),
|
||||
$logManager
|
||||
);
|
||||
}
|
||||
|
@ -50,7 +49,7 @@ class DatesFactoryTest extends TestCase
|
|||
{
|
||||
$subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin');
|
||||
|
||||
$result = $subject->createDates($unkownInput, false);
|
||||
$result = $subject->createDates($this->createStub(Import::class), $unkownInput, false);
|
||||
|
||||
self::assertInstanceOf(Generator::class, $result);
|
||||
self::assertCount(0, iterator_to_array($result));
|
||||
|
@ -76,7 +75,7 @@ class DatesFactoryTest extends TestCase
|
|||
{
|
||||
$subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin');
|
||||
|
||||
$result = $subject->createDates([[
|
||||
$result = $subject->createDates($this->createStub(Import::class), [[
|
||||
'start' => '2022-04-01T16:00:00+02:00',
|
||||
'end' => '2022-04-01T17:00:00+02:00',
|
||||
'tz' => 'Europe/Berlin',
|
||||
|
@ -98,9 +97,11 @@ class DatesFactoryTest extends TestCase
|
|||
#[Test]
|
||||
public function returnsWeeklyWithConfiguredRepeat(): void
|
||||
{
|
||||
$import = $this->createStub(Import::class);
|
||||
$import->method('getRepeatUntil')->willReturn('+60 days');
|
||||
$subject = $this->createTestSubject('2023-01-01T13:17:24 Europe/Berlin');
|
||||
|
||||
$result = $subject->createDates([[
|
||||
$result = $subject->createDates($import, [[
|
||||
'weekdays' => [
|
||||
'Monday',
|
||||
'Friday',
|
||||
|
@ -123,7 +124,7 @@ class DatesFactoryTest extends TestCase
|
|||
{
|
||||
$subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin');
|
||||
|
||||
$result = $subject->createDates([[
|
||||
$result = $subject->createDates($this->createStub(Import::class), [[
|
||||
'start' => '2022-04-01T16:00:00+02:00',
|
||||
'end' => '2022-04-01T17:00:00+02:00',
|
||||
'tz' => 'Europe/Berlin',
|
||||
|
@ -147,7 +148,7 @@ class DatesFactoryTest extends TestCase
|
|||
{
|
||||
$subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin');
|
||||
|
||||
$result = $subject->createDates([[
|
||||
$result = $subject->createDates($this->createStub(Import::class), [[
|
||||
'start' => '2022-10-29T16:00:00+02:00',
|
||||
'end' => '2022-10-29T17:00:00+02:00',
|
||||
'repeatUntil' => '2022-11-02T17:00:00+01:00',
|
||||
|
@ -176,7 +177,7 @@ class DatesFactoryTest extends TestCase
|
|||
{
|
||||
$subject = $this->createTestSubject('2022-08-29T13:17:24 Europe/Berlin');
|
||||
|
||||
$result = $subject->createDates([[
|
||||
$result = $subject->createDates($this->createStub(Import::class), [[
|
||||
'start' => '2022-10-29T16:00:00+02:00',
|
||||
'end' => '2022-10-29T17:00:00+02:00',
|
||||
'repeatUntil' => '2022-11-02T17:00:00+01:00',
|
||||
|
@ -205,7 +206,7 @@ class DatesFactoryTest extends TestCase
|
|||
{
|
||||
$subject = $this->createTestSubject('2022-08-29T13:17:24 Europe/Berlin');
|
||||
|
||||
$result = $subject->createDates([[
|
||||
$result = $subject->createDates($this->createStub(Import::class), [[
|
||||
'weekdays' => [
|
||||
'Saturday',
|
||||
'Sunday',
|
||||
|
@ -246,7 +247,7 @@ class DatesFactoryTest extends TestCase
|
|||
{
|
||||
$subject = $this->createTestSubject('2022-08-29T13:17:24 Europe/Berlin');
|
||||
|
||||
$result = $subject->createDates([[
|
||||
$result = $subject->createDates($this->createStub(Import::class), [[
|
||||
'weekdays' => [
|
||||
'Saturday',
|
||||
'Sunday',
|
||||
|
@ -287,7 +288,7 @@ class DatesFactoryTest extends TestCase
|
|||
{
|
||||
$subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin');
|
||||
|
||||
$result = $subject->createDates([
|
||||
$result = $subject->createDates($this->createStub(Import::class), [
|
||||
[
|
||||
'start' => '2022-06-21T16:00:00+02:00',
|
||||
'end' => '2022-06-21T22:00:00+02:00',
|
||||
|
@ -332,7 +333,7 @@ class DatesFactoryTest extends TestCase
|
|||
{
|
||||
$subject = $this->createTestSubject('2022-01-01T13:17:24 Europe/Berlin');
|
||||
|
||||
$result = $subject->createDates([
|
||||
$result = $subject->createDates($this->createStub(Import::class), [
|
||||
[
|
||||
'start' => '2022-06-21T16:00:00+02:00',
|
||||
'end' => '2022-06-21T22:00:00+02:00',
|
||||
|
|
|
@ -9,7 +9,6 @@ use PHPUnit\Framework\Attributes\Test;
|
|||
use PHPUnit\Framework\MockObject\Stub;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use WerkraumMedia\Events\Domain\Model\Import;
|
||||
use WerkraumMedia\Events\Service\DestinationDataImportService\ArrayBasedConfigurationService;
|
||||
use WerkraumMedia\Events\Service\DestinationDataImportService\UrlFactory;
|
||||
|
||||
class UrlFactoryTest extends TestCase
|
||||
|
@ -17,11 +16,7 @@ class UrlFactoryTest extends TestCase
|
|||
#[Test]
|
||||
public function canBeCreated(): void
|
||||
{
|
||||
$configurationManager = new ArrayBasedConfigurationService([]);
|
||||
|
||||
$subject = new UrlFactory(
|
||||
$configurationManager
|
||||
);
|
||||
$subject = new UrlFactory();
|
||||
|
||||
self::assertInstanceOf(
|
||||
UrlFactory::class,
|
||||
|
@ -31,16 +26,14 @@ class UrlFactoryTest extends TestCase
|
|||
|
||||
#[DataProvider('possibleImports')]
|
||||
#[Test]
|
||||
/**
|
||||
* @param Stub&Import $import
|
||||
*/
|
||||
public function createSearchResultUrl(
|
||||
Stub $import,
|
||||
array $settings,
|
||||
Import $import,
|
||||
string $expectedResult
|
||||
): void {
|
||||
$configurationManager = new ArrayBasedConfigurationService($settings);
|
||||
|
||||
$subject = new UrlFactory(
|
||||
$configurationManager
|
||||
);
|
||||
$subject = new UrlFactory();
|
||||
|
||||
$result = $subject->createSearchResultUrl($import);
|
||||
|
||||
|
@ -56,62 +49,42 @@ class UrlFactoryTest extends TestCase
|
|||
'All provided' => [
|
||||
'import' => (function () {
|
||||
$import = self::createStub(Import::class);
|
||||
$import->method('getRestLicenseKey')->willReturn('licenseKey');
|
||||
$import->method('getRestExperience')->willReturn('experience');
|
||||
$import->method('getSearchQuery')->willReturn('');
|
||||
$import->method('getRestMode')->willReturn('restMode');
|
||||
$import->method('getRestLimit')->willReturn(500);
|
||||
$import->method('getRestSearchQuery')->willReturn('');
|
||||
|
||||
return $import;
|
||||
})(),
|
||||
'settings' => [
|
||||
'restUrl' => 'https://example.com/path',
|
||||
'license' => 'licenseKey',
|
||||
'restType' => 'restType',
|
||||
'restMode' => 'restMode',
|
||||
'restLimit' => 'restLimit',
|
||||
'restTemplate' => 'restTemplate',
|
||||
],
|
||||
'expectedResult' => 'https://example.com/path?experience=experience&licensekey=licenseKey&type=restType&mode=restMode&limit=restLimit&template=restTemplate',
|
||||
'expectedResult' => 'http://meta.et4.de/rest.ashx/search/?experience=experience&licensekey=licenseKey&type=Event&mode=restMode&limit=500&template=ET2014A.json',
|
||||
],
|
||||
'All missing' => [
|
||||
'import' => (function () {
|
||||
$import = self::createStub(Import::class);
|
||||
$import->method('getRestExperience')->willReturn('');
|
||||
$import->method('getSearchQuery')->willReturn('');
|
||||
|
||||
return $import;
|
||||
return self::createStub(Import::class);
|
||||
})(),
|
||||
'settings' => [
|
||||
'restUrl' => 'https://example.com/path',
|
||||
],
|
||||
'expectedResult' => 'https://example.com/path',
|
||||
'expectedResult' => 'http://meta.et4.de/rest.ashx/search/?type=Event&template=ET2014A.json',
|
||||
],
|
||||
'Some missing' => [
|
||||
'import' => (function () {
|
||||
$import = self::createStub(Import::class);
|
||||
$import->method('getRestLicenseKey')->willReturn('licenseKey');
|
||||
$import->method('getRestExperience')->willReturn('experience');
|
||||
$import->method('getSearchQuery')->willReturn('');
|
||||
$import->method('getRestLimit')->willReturn(500);
|
||||
|
||||
return $import;
|
||||
})(),
|
||||
'settings' => [
|
||||
'restUrl' => 'https://example.com/path',
|
||||
'license' => 'licenseKey',
|
||||
'restLimit' => 'restLimit',
|
||||
'restTemplate' => 'restTemplate',
|
||||
],
|
||||
'expectedResult' => 'https://example.com/path?experience=experience&licensekey=licenseKey&limit=restLimit&template=restTemplate',
|
||||
'expectedResult' => 'http://meta.et4.de/rest.ashx/search/?experience=experience&licensekey=licenseKey&type=Event&limit=500&template=ET2014A.json',
|
||||
],
|
||||
'With search query' => [
|
||||
'import' => (function () {
|
||||
$import = self::createStub(Import::class);
|
||||
$import->method('getRestExperience')->willReturn('experience');
|
||||
$import->method('getSearchQuery')->willReturn('name:"Test Something"');
|
||||
$import->method('getRestSearchQuery')->willReturn('name:"Test Something"');
|
||||
|
||||
return $import;
|
||||
})(),
|
||||
'settings' => [
|
||||
'restUrl' => 'https://example.com/path',
|
||||
],
|
||||
'expectedResult' => 'https://example.com/path?experience=experience&q=name%3A%22Test+Something%22',
|
||||
'expectedResult' => 'http://meta.et4.de/rest.ashx/search/?experience=experience&type=Event&template=ET2014A.json&q=name%3A%22Test+Something%22',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
@ -83,10 +83,14 @@ CREATE TABLE tx_events_domain_model_import (
|
|||
|
||||
region int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
|
||||
rest_license_key text,
|
||||
rest_experience varchar(1024) DEFAULT '' NOT NULL,
|
||||
rest_mode varchar(1024) DEFAULT 'next_months,12' NOT NULL,
|
||||
rest_limit int(11) unsigned DEFAULT '500' NOT NULL,
|
||||
rest_search_query text,
|
||||
|
||||
import_features tinyint(4) DEFAULT '0' NOT NULL,
|
||||
import_repeat_until varchar(255) DEFAULT '' NOT NULL,
|
||||
);
|
||||
|
||||
CREATE TABLE tx_events_domain_model_location (
|
||||
|
|
Loading…
Reference in a new issue