2021-02-16 17:12:47 +01:00
|
|
|
<?php
|
|
|
|
|
2021-08-10 09:55:15 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-02-16 17:12:47 +01:00
|
|
|
namespace WerkraumMedia\ThueCat\Tests\Functional;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 Daniel Siepmann <coding@daniel-siepmann.de>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
* 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
use TYPO3\CMS\Core\Localization\LanguageService;
|
|
|
|
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase as TestCase;
|
2022-09-13 09:05:47 +02:00
|
|
|
use WerkraumMedia\ThueCat\Domain\Import\Importer;
|
|
|
|
use WerkraumMedia\ThueCat\Domain\Repository\Backend\ImportConfigurationRepository;
|
2021-02-16 17:12:47 +01:00
|
|
|
|
|
|
|
/**
|
2021-06-01 11:11:50 +02:00
|
|
|
* @covers \WerkraumMedia\ThueCat\DependencyInjection\ConverterPass
|
|
|
|
* @covers \WerkraumMedia\ThueCat\DependencyInjection\UrlProvidersPass
|
|
|
|
* @covers \WerkraumMedia\ThueCat\Domain\Import\Importer\SaveData
|
|
|
|
* @covers \WerkraumMedia\ThueCat\Domain\Repository\Backend\ImportLogRepository
|
|
|
|
* @covers \WerkraumMedia\ThueCat\Domain\Repository\Backend\OrganisationRepository
|
|
|
|
* @covers \WerkraumMedia\ThueCat\Domain\Repository\Backend\TownRepository
|
|
|
|
* @covers \WerkraumMedia\ThueCat\Extension
|
|
|
|
* @covers \WerkraumMedia\ThueCat\Typo3Wrapper\TranslationService
|
2021-02-16 17:12:47 +01:00
|
|
|
*
|
2021-06-01 11:11:50 +02:00
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\Converter\Organisation
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\Converter\Registry
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\Converter\TouristAttraction
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\Converter\TouristInformation
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\Converter\Town
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\Importer
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\Importer\FetchData
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\Importer\LanguageHandling
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\Model\EntityCollection
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\Model\GenericEntity
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\RequestFactory
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\UrlProvider\Registry
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\UrlProvider\StaticUrlProvider
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Import\UrlProvider\SyncScopeUrlProvider
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Model\Backend\ImportConfiguration
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Model\Backend\ImportLog
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Model\Backend\ImportLogEntry
|
|
|
|
* @uses \WerkraumMedia\ThueCat\Domain\Model\Backend\ImportLogEntry
|
2021-02-16 17:12:47 +01:00
|
|
|
*
|
|
|
|
* @testdox The import
|
|
|
|
*/
|
|
|
|
class ImportTest extends TestCase
|
|
|
|
{
|
|
|
|
protected $coreExtensionsToLoad = [
|
|
|
|
'core',
|
|
|
|
'backend',
|
|
|
|
'extbase',
|
|
|
|
'frontend',
|
|
|
|
];
|
|
|
|
|
|
|
|
protected $testExtensionsToLoad = [
|
|
|
|
'typo3conf/ext/thuecat/',
|
|
|
|
];
|
|
|
|
|
2021-02-16 17:12:47 +01:00
|
|
|
protected $pathsToLinkInTestInstance = [
|
|
|
|
'typo3conf/ext/thuecat/Tests/Functional/Fixtures/Import/Sites/' => 'typo3conf/sites',
|
|
|
|
];
|
|
|
|
|
2021-05-31 13:32:58 +02:00
|
|
|
protected $configurationToUseInTestInstance = [
|
|
|
|
'EXTENSIONS' => [
|
|
|
|
'thuecat' => [
|
|
|
|
'apiKey' => null,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
];
|
|
|
|
|
2021-02-16 17:12:47 +01:00
|
|
|
protected function setUp(): void
|
|
|
|
{
|
|
|
|
parent::setUp();
|
2022-09-13 09:05:47 +02:00
|
|
|
GuzzleClientFaker::registerClient();
|
2021-02-16 17:12:47 +01:00
|
|
|
|
|
|
|
$this->setUpBackendUserFromFixture(1);
|
|
|
|
|
|
|
|
$GLOBALS['LANG'] = $this->getContainer()->get(LanguageService::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function tearDown(): void
|
|
|
|
{
|
|
|
|
unset($GLOBALS['LANG']);
|
2022-09-13 09:05:47 +02:00
|
|
|
GuzzleClientFaker::tearDown();
|
2021-02-16 17:12:47 +01:00
|
|
|
|
|
|
|
parent::tearDown();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function importsFreshOrganization(): void
|
|
|
|
{
|
|
|
|
$this->importDataSet(__DIR__ . '/Fixtures/Import/ImportsFreshOrganization.xml');
|
2022-09-13 09:05:47 +02:00
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/018132452787-ngbe.json');
|
2021-02-16 17:12:47 +01:00
|
|
|
|
2022-09-13 09:05:47 +02:00
|
|
|
$configuration = $this->get(ImportConfigurationRepository::class)->findByUid(1);
|
|
|
|
$this->get(Importer::class)->importConfiguration($configuration);
|
2021-02-16 17:12:47 +01:00
|
|
|
|
2021-02-17 15:33:15 +01:00
|
|
|
$this->assertCSVDataSet('EXT:thuecat/Tests/Functional/Fixtures/Import/ImportsFreshOrganization.csv');
|
2021-02-16 17:12:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function updatesExistingOrganization(): void
|
|
|
|
{
|
|
|
|
$this->importDataSet(__DIR__ . '/Fixtures/Import/UpdatesExistingOrganization.xml');
|
2022-09-13 09:05:47 +02:00
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/018132452787-ngbe.json');
|
2021-02-16 17:12:47 +01:00
|
|
|
|
2022-09-13 09:05:47 +02:00
|
|
|
$configuration = $this->get(ImportConfigurationRepository::class)->findByUid(1);
|
|
|
|
$this->get(Importer::class)->importConfiguration($configuration);
|
2021-02-16 17:12:47 +01:00
|
|
|
|
|
|
|
$organisations = $this->getAllRecords('tx_thuecat_organisation');
|
|
|
|
self::assertCount(1, $organisations);
|
|
|
|
self::assertSame('https://thuecat.org/resources/018132452787-ngbe', $organisations[0]['remote_id']);
|
|
|
|
self::assertSame('Erfurt Tourismus und Marketing GmbH', $organisations[0]['title']);
|
2021-09-08 12:12:25 +02:00
|
|
|
self::assertSame(1, (int)$organisations[0]['uid']);
|
2021-02-16 17:12:47 +01:00
|
|
|
|
|
|
|
$importLogs = $this->getAllRecords('tx_thuecat_import_log');
|
|
|
|
self::assertCount(1, $importLogs);
|
2021-09-08 12:12:25 +02:00
|
|
|
self::assertSame(1, (int)$importLogs[0]['configuration']);
|
|
|
|
self::assertSame(1, (int)$importLogs[0]['uid']);
|
2021-02-16 17:12:47 +01:00
|
|
|
|
|
|
|
$importLogEntries = $this->getAllRecords('tx_thuecat_import_log_entry');
|
|
|
|
self::assertCount(1, $importLogEntries);
|
2021-09-08 12:12:25 +02:00
|
|
|
self::assertSame(1, (int)$importLogEntries[0]['import_log']);
|
|
|
|
self::assertSame(1, (int)$importLogEntries[0]['record_uid']);
|
2021-02-16 17:12:47 +01:00
|
|
|
self::assertSame('tx_thuecat_organisation', $importLogEntries[0]['table_name']);
|
2021-09-08 12:12:25 +02:00
|
|
|
self::assertSame(0, (int)$importLogEntries[0]['insertion']);
|
2021-02-16 17:12:47 +01:00
|
|
|
self::assertSame('[]', $importLogEntries[0]['errors']);
|
|
|
|
}
|
|
|
|
|
2021-08-09 08:34:20 +02:00
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function importsTown(): void
|
|
|
|
{
|
|
|
|
$this->importDataSet(__DIR__ . '/Fixtures/Import/ImportsTown.xml');
|
2022-09-13 09:05:47 +02:00
|
|
|
// TODO: Check why we request both twice.
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/043064193523-jcyt.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/018132452787-ngbe.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/043064193523-jcyt.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/018132452787-ngbe.json');
|
2021-08-09 08:34:20 +02:00
|
|
|
|
2022-09-13 09:05:47 +02:00
|
|
|
$configuration = $this->get(ImportConfigurationRepository::class)->findByUid(1);
|
|
|
|
$this->get(Importer::class)->importConfiguration($configuration);
|
2021-08-09 08:34:20 +02:00
|
|
|
|
|
|
|
$this->assertCSVDataSet('EXT:thuecat/Tests/Functional/Fixtures/Import/ImportsTown.csv');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function importsTownWithRelation(): void
|
|
|
|
{
|
|
|
|
$this->importDataSet(__DIR__ . '/Fixtures/Import/ImportsTownWithRelation.xml');
|
2022-09-13 09:05:47 +02:00
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/043064193523-jcyt.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/018132452787-ngbe.json');
|
2021-08-09 08:34:20 +02:00
|
|
|
|
2022-09-13 09:05:47 +02:00
|
|
|
$configuration = $this->get(ImportConfigurationRepository::class)->findByUid(1);
|
|
|
|
$this->get(Importer::class)->importConfiguration($configuration);
|
2021-08-09 08:34:20 +02:00
|
|
|
|
|
|
|
$this->assertCSVDataSet('EXT:thuecat/Tests/Functional/Fixtures/Import/ImportsTownWithRelation.csv');
|
|
|
|
}
|
|
|
|
|
2021-02-16 17:12:47 +01:00
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function importsTouristAttractionsWithRelations(): void
|
|
|
|
{
|
|
|
|
$this->importDataSet(__DIR__ . '/Fixtures/Import/ImportsTouristAttractionsWithRelations.xml');
|
2022-09-13 09:05:47 +02:00
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/835224016581-dara.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/018132452787-ngbe.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/043064193523-jcyt.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/573211638937-gmqb.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/508431710173-wwne.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_5159216.json');
|
|
|
|
GuzzleClientFaker::appendNotFoundResponse();
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_5159186.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/396420044896-drzt.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_6486108.json');
|
|
|
|
GuzzleClientFaker::appendNotFoundResponse();
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/165868194223-zmqf.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/497839263245-edbm.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_5099196.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/e_23bec7f80c864c358da033dd75328f27-rfa.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/215230952334-yyno.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/052821473718-oxfq.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_134362.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_134288.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_652340.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/440055527204-ocar.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_5197164.json');
|
|
|
|
|
|
|
|
$configuration = $this->get(ImportConfigurationRepository::class)->findByUid(1);
|
|
|
|
$this->get(Importer::class)->importConfiguration($configuration);
|
2021-02-16 17:12:47 +01:00
|
|
|
|
2021-08-18 13:54:18 +02:00
|
|
|
$this->assertCSVDataSet('EXT:thuecat/Tests/Functional/Fixtures/Import/ImportsTouristAttractionsWithRelations.csv');
|
2021-02-16 17:12:47 +01:00
|
|
|
}
|
|
|
|
|
2022-11-24 15:55:50 +01:00
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function importsTouristAttractionsWithFilteredOpeningHours(): void
|
|
|
|
{
|
|
|
|
$this->importDataSet(__DIR__ . '/Fixtures/Import/ImportsTouristAttractionWithFilteredOpeningHours.xml');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/opening-hours-to-filter.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/018132452787-ngbe.json');
|
|
|
|
|
|
|
|
$configuration = $this->get(ImportConfigurationRepository::class)->findByUid(1);
|
|
|
|
$this->get(Importer::class)->importConfiguration($configuration);
|
|
|
|
|
|
|
|
$this->assertCSVDataSet('EXT:thuecat/Tests/Functional/Fixtures/Import/ImportsTouristAttractionsWithFilteredOpeningHours.csv');
|
|
|
|
}
|
|
|
|
|
2022-11-28 11:06:54 +01:00
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function importsTouristAttractionsWithSpecialOpeningHours(): void
|
|
|
|
{
|
|
|
|
$this->importDataSet(__DIR__ . '/Fixtures/Import/ImportsTouristAttractionWithSpecialOpeningHours.xml');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/special-opening-hours.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/018132452787-ngbe.json');
|
|
|
|
|
|
|
|
$configuration = $this->get(ImportConfigurationRepository::class)->findByUid(1);
|
|
|
|
$this->get(Importer::class)->importConfiguration($configuration);
|
|
|
|
|
|
|
|
$this->assertCSVDataSet('EXT:thuecat/Tests/Functional/Fixtures/Import/ImportsTouristAttractionsWithSpecialOpeningHours.csv');
|
|
|
|
}
|
|
|
|
|
2021-08-09 08:54:58 +02:00
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function importsTouristInformationWithRelation(): void
|
|
|
|
{
|
|
|
|
$this->importDataSet(__DIR__ . '/Fixtures/Import/ImportsTouristInformationWithRelation.xml');
|
2022-09-13 09:05:47 +02:00
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/333039283321-xxwg.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/018132452787-ngbe.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/043064193523-jcyt.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/573211638937-gmqb.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/356133173991-cryw.json');
|
2021-08-09 08:54:58 +02:00
|
|
|
|
2022-09-13 09:05:47 +02:00
|
|
|
$configuration = $this->get(ImportConfigurationRepository::class)->findByUid(1);
|
|
|
|
$this->get(Importer::class)->importConfiguration($configuration);
|
2021-08-09 08:54:58 +02:00
|
|
|
|
2021-08-18 13:54:18 +02:00
|
|
|
$this->assertCSVDataSet('EXT:thuecat/Tests/Functional/Fixtures/Import/ImportsTouristInformationWithRelation.csv');
|
2021-08-09 08:54:58 +02:00
|
|
|
}
|
|
|
|
|
2021-05-31 13:32:58 +02:00
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function importsBasedOnSyncScope(): void
|
|
|
|
{
|
|
|
|
$this->importDataSet(__DIR__ . '/Fixtures/Import/ImportsSyncScope.xml');
|
2022-09-13 09:05:47 +02:00
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/cdb.thuecat.org/api/ext-sync/get-updated-nodes/dd4615dc-58a6-4648-a7ce-4950293a06db.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/835224016581-dara.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/018132452787-ngbe.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/043064193523-jcyt.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/573211638937-gmqb.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/508431710173-wwne.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_5159216.json');
|
|
|
|
GuzzleClientFaker::appendNotFoundResponse();
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_5159186.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/396420044896-drzt.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_6486108.json');
|
|
|
|
GuzzleClientFaker::appendNotFoundResponse();
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/165868194223-zmqf.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/497839263245-edbm.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_5099196.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/e_23bec7f80c864c358da033dd75328f27-rfa.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/215230952334-yyno.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/052821473718-oxfq.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_134362.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_134288.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_652340.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/440055527204-ocar.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_5197164.json');
|
|
|
|
|
|
|
|
$configuration = $this->get(ImportConfigurationRepository::class)->findByUid(1);
|
|
|
|
$this->get(Importer::class)->importConfiguration($configuration);
|
2021-05-31 13:32:58 +02:00
|
|
|
|
2021-08-18 13:54:18 +02:00
|
|
|
$this->assertCSVDataSet('EXT:thuecat/Tests/Functional/Fixtures/Import/ImportsSyncScope.csv');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
* @testdox Referencing the same thing multiple times only adds it once.
|
|
|
|
*/
|
|
|
|
public function importWithMultipleReferencesToSameObject(): void
|
|
|
|
{
|
|
|
|
$this->importDataSet(__DIR__ . '/Fixtures/Import/ImportWithMultipleReferencesToSameObject.xml');
|
|
|
|
|
2022-09-13 09:05:47 +02:00
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/835224016581-dara.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/018132452787-ngbe.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/043064193523-jcyt.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/573211638937-gmqb.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/508431710173-wwne.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_5159216.json');
|
|
|
|
GuzzleClientFaker::appendNotFoundResponse();
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_5159186.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/396420044896-drzt.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_6486108.json');
|
|
|
|
GuzzleClientFaker::appendNotFoundResponse();
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/165868194223-zmqf.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/497839263245-edbm.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_5099196.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/e_23bec7f80c864c358da033dd75328f27-rfa.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/215230952334-yyno.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/052821473718-oxfq.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_134362.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_134288.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_652340.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/440055527204-ocar.json');
|
|
|
|
GuzzleClientFaker::appendResponseFromFile(__DIR__ . '/Fixtures/Import/Guzzle/thuecat.org/resources/dms_5197164.json');
|
|
|
|
|
|
|
|
$configuration = $this->get(ImportConfigurationRepository::class)->findByUid(1);
|
|
|
|
$this->get(Importer::class)->importConfiguration($configuration);
|
2021-05-31 13:32:58 +02:00
|
|
|
|
2021-08-18 13:54:18 +02:00
|
|
|
$this->assertCSVDataSet('EXT:thuecat/Tests/Functional/Fixtures/Import/ImportWithMultipleReferencesToSameObject.csv');
|
2021-05-31 13:32:58 +02:00
|
|
|
}
|
2021-02-16 17:12:47 +01:00
|
|
|
}
|