Skip to content

Commit 8d11025

Browse files
committed
MC-24256: [Integration Test] Export Customers Main File with multiple websites
1 parent c2e2646 commit 8d11025

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
use Magento\TestFramework\Helper\Bootstrap;
9+
use Magento\Customer\Api\CustomerRepositoryInterface;
10+
11+
require __DIR__ . '/customers.php';
12+
require __DIR__ . '/../../../Store/_files/website.php';
13+
14+
$objectManager = Bootstrap::getObjectManager();
15+
$repository = $objectManager->create(CustomerRepositoryInterface::class);
16+
$customer = $repository->get('customer@example.com');
17+
$customer->setWebsiteId($website->getId());
18+
$repository->save($customer);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
include __DIR__ . '/customers_rollback.php';
9+
include __DIR__ . '/../../../Store/_files/website_rollback.php';

dev/tests/integration/testsuite/Magento/CustomerImportExport/Model/Export/CustomerTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ public function testExport()
7575
$this->checkExportData($lines, $expectedAttributes);
7676
}
7777

78+
/**
79+
* Export with Multi Websites "Customer Main File".
80+
*
81+
* @magentoDataFixture Magento/Customer/_files/import_export/customers_with_websites.php
82+
* @return void
83+
*/
84+
public function testExportWithMultiWebsites(): void
85+
{
86+
$this->processCustomerAttribute();
87+
$expectedAttributes = $this->getExpectedAttributes();
88+
$lines = $this->export($expectedAttributes);
89+
$this->checkExportData($lines, $expectedAttributes);
90+
}
91+
7892
/**
7993
* Return attributes which should be exported.
8094
*

0 commit comments

Comments
 (0)