1 | <?php |
||
2 | |||
3 | /** |
||
4 | * MIT License |
||
5 | * For full license information, please view the LICENSE file that was distributed with this source code. |
||
6 | */ |
||
7 | |||
8 | namespace SprykerTest\Zed\CmsPageDataImport\Communication\Plugin; |
||
9 | |||
10 | use Codeception\Test\Unit; |
||
11 | use Generated\Shared\Transfer\DataImporterConfigurationTransfer; |
||
12 | use Generated\Shared\Transfer\DataImporterReaderConfigurationTransfer; |
||
13 | use Generated\Shared\Transfer\DataImporterReportTransfer; |
||
14 | use Spryker\Zed\CmsPageDataImport\CmsPageDataImportConfig; |
||
15 | use Spryker\Zed\CmsPageDataImport\Communication\Plugin\CmsPageStoreDataImportPlugin; |
||
16 | |||
17 | /** |
||
18 | * Auto-generated group annotations |
||
19 | * |
||
20 | * @group SprykerTest |
||
21 | * @group Zed |
||
22 | * @group CmsPageDataImport |
||
23 | * @group Communication |
||
24 | * @group Plugin |
||
25 | * @group CmsPageStoreDataImportPluginTest |
||
26 | * Add your own group annotations below this line |
||
27 | */ |
||
28 | class CmsPageStoreDataImportPluginTest extends Unit |
||
29 | { |
||
30 | /** |
||
31 | * @var \SprykerTest\Zed\CmsPageDataImport\CmsPageDataImportCommunicationTester |
||
32 | */ |
||
33 | protected $tester; |
||
34 | |||
35 | /** |
||
36 | * @return void |
||
37 | */ |
||
38 | public function testImportImportsCmsPage(): void |
||
39 | { |
||
40 | $this->tester->ensureDatabaseTableCmsPageStoreIsEmpty(); |
||
41 | |||
42 | $dataImporterReaderConfigurationTransfer = new DataImporterReaderConfigurationTransfer(); |
||
43 | $dataImporterReaderConfigurationTransfer->setFileName(codecept_data_dir() . 'import/cms_page_store.csv'); |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
44 | |||
45 | $dataImportConfigurationTransfer = new DataImporterConfigurationTransfer(); |
||
46 | $dataImportConfigurationTransfer->setReaderConfiguration($dataImporterReaderConfigurationTransfer); |
||
47 | |||
48 | $cmsPageStoreDataImportPlugin = new CmsPageStoreDataImportPlugin(); |
||
49 | $dataImporterReportTransfer = $cmsPageStoreDataImportPlugin->import($dataImportConfigurationTransfer); |
||
50 | |||
51 | $this->assertInstanceOf(DataImporterReportTransfer::class, $dataImporterReportTransfer); |
||
52 | |||
53 | $this->tester->assertDatabaseTableCmsPageStoreContainsData(); |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * @return void |
||
58 | */ |
||
59 | public function testGetImportTypeReturnsTypeOfImporter(): void |
||
60 | { |
||
61 | $cmsPageStoreDataImportPlugin = new CmsPageStoreDataImportPlugin(); |
||
62 | $this->assertSame(CmsPageDataImportConfig::IMPORT_TYPE_CMS_PAGE_STORE, $cmsPageStoreDataImportPlugin->getImportType()); |
||
63 | } |
||
64 | } |
||
65 |