diff --git a/Classes/Command/DestinationDataImportCommand.php b/Classes/Command/DestinationDataImportCommand.php index 537d4d6..a8a02d2 100644 --- a/Classes/Command/DestinationDataImportCommand.php +++ b/Classes/Command/DestinationDataImportCommand.php @@ -54,10 +54,17 @@ class DestinationDataImportCommand extends Command { Bootstrap::initializeBackendAuthentication(); + $regionUid = $input->getArgument('region-uid'); + if (is_numeric($regionUid)) { + $regionUid = (int) $regionUid; + } else { + $regionUid = null; + } + return $this->destinationDataImportService->import( $input->getArgument('rest-experience'), $input->getArgument('storage-pid'), - $input->getArgument('region-uid'), + $regionUid, $input->getArgument('files-folder') ); } diff --git a/Tests/Functional/Import/DestinationDataTest/ImportCleansTransientFilesTest.php b/Tests/Functional/Import/DestinationDataTest/ImportCleansTransientFilesTest.php index 24f73a2..21efcaa 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportCleansTransientFilesTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportCleansTransientFilesTest.php @@ -35,7 +35,7 @@ class ImportCleansTransientFilesTest extends AbstractTest ]); $tester = $this->executeCommand([ - 'storage-pid' => 2, + 'storage-pid' => '2', 'rest-experience' => 'beispielstadt', 'files-folder' => $fileImportPath, ]); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportDoesNotUseUploadsFolderTest.php b/Tests/Functional/Import/DestinationDataTest/ImportDoesNotUseUploadsFolderTest.php index e1ffb0a..a2c644c 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportDoesNotUseUploadsFolderTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportDoesNotUseUploadsFolderTest.php @@ -36,7 +36,7 @@ class ImportDoesNotUseUploadsFolderTest extends AbstractTest ]); $tester = $this->executeCommand([ - 'storage-pid' => 2, + 'storage-pid' => '2', 'rest-experience' => 'beispielstadt', 'files-folder' => $fileImportPath, ]); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsExampleAsExpectedTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsExampleAsExpectedTest.php index 89cd6d7..acaf5fa 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsExampleAsExpectedTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsExampleAsExpectedTest.php @@ -36,10 +36,10 @@ class ImportsExampleAsExpectedTest extends AbstractTest ]); $tester = $this->executeCommand([ - 'storage-pid' => 2, + 'storage-pid' => '2', 'rest-experience' => 'beispielstadt', 'files-folder' => $fileImportPath, - 'region-uid' => 1, + 'region-uid' => '1', ]); self::assertSame(0, $tester->getStatusCode()); diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutRegionIfNotProvidedTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutRegionIfNotProvidedTest.php index e98b136..e383e79 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsWithoutRegionIfNotProvidedTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsWithoutRegionIfNotProvidedTest.php @@ -8,7 +8,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; /** * @testdox DestinationData import */ -class ImportsWithoutRegionIfNotProvided extends AbstractTest +class ImportsWithoutRegionIfNotProvidedTest extends AbstractTest { /** * @test @@ -33,9 +33,10 @@ class ImportsWithoutRegionIfNotProvided extends AbstractTest new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ExampleImage.jpg') ?: ''), ]); $tester = $this->executeCommand([ - 'storage-pid' => 2, + 'storage-pid' => '2', 'rest-experience' => 'beispielstadt', 'files-folder' => $fileImportPath, + 'region-uid' => '', ]); self::assertSame(0, $tester->getStatusCode());