Skip to content

Commit 6444ecc

Browse files
author
Valeriy Nayda
committed
MSI: Assign Website at the time of Creation to the Default Stock
1 parent 0116b31 commit 6444ecc

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

app/code/Magento/InventorySales/Test/Integration/AssignWebsiteToDefaultStockTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@ protected function setUp()
3939
$this->defaultStockProvider = Bootstrap::getObjectManager()->get(DefaultStockProviderInterface::class);
4040
}
4141

42+
/**
43+
* @magentoApiDataFixture ../../../../app/code/Magento/InventorySalesApi/Test/_files/websites.php
44+
*/
45+
public function testCreateWebsitesViaFixtureIfSalesChannelsAreEmpty()
46+
{
47+
$defaultStockId = $this->defaultStockProvider->getId();
48+
$defaultStock = $this->stockRepository->get($defaultStockId);
49+
50+
$extensionAttributes = $defaultStock->getExtensionAttributes();
51+
$salesChannels = $extensionAttributes->getSalesChannels();
52+
$this->assertContainsOnlyInstancesOf(SalesChannelInterface::class, $salesChannels);
53+
$this->assertCount(3, $salesChannels);
54+
}
55+
4256
/**
4357
* Creates website inside of test so need to enable db isolation to prevent change db state after test execution
4458
* @magentoDbIsolation enabled

dev/tests/integration/phpunit.xml.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
<directory suffix="Test.php">../../../app/code/*/*/Test/Integration</directory>
2525
<exclude>testsuite/Magento/MemoryUsageTest.php</exclude>
2626
</testsuite>
27+
<testsuite name="msi">
28+
<directory suffix="Test.php">../../../app/code/*/*/Test/Integration</directory>
29+
</testsuite>
2730
</testsuites>
2831
<!-- Code coverage filters -->
2932
<filter>

0 commit comments

Comments
 (0)