Skip to content

Commit dd2244c

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MAGETWO-90294
2 parents 2c12090 + b2eb795 commit dd2244c

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
global:
2323
- COMPOSER_BIN_DIR=~/bin
2424
- INTEGRATION_SETS=3
25-
- NODE_JS_VERSION=6
25+
- NODE_JS_VERSION=8
2626
- MAGENTO_HOST_NAME="magento2.travis"
2727
matrix:
2828
- TEST_SUITE=unit

dev/tests/integration/testsuite/Magento/Setup/Model/FixtureGenerator/ProductGeneratorTest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
use Magento\Catalog\Api\ProductRepositoryInterface;
1010
use Magento\Framework\Indexer\IndexerRegistry;
1111
use Magento\Indexer\Model\Config;
12+
use Magento\Store\Model\WebsiteRepository;
1213
use Magento\TestFramework\Helper\Bootstrap;
1314

1415
/**
1516
* @magentoAppArea adminhtml
1617
* @magentoDataFixture Magento/Catalog/_files/category.php
18+
* @magentoDataFixture Magento/Store/_files/second_website_with_two_stores.php
1719
*/
1820
class ProductGeneratorTest extends \PHPUnit\Framework\TestCase
1921
{
@@ -37,6 +39,11 @@ class ProductGeneratorTest extends \PHPUnit\Framework\TestCase
3739
*/
3840
private $indexersState = [];
3941

42+
/**
43+
* @var WebsiteRepository
44+
*/
45+
private $websiteRepository;
46+
4047
/**
4148
* @return void
4249
*/
@@ -45,7 +52,7 @@ protected function setUp()
4552
$this->objectManager = Bootstrap::getObjectManager();
4653
$this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
4754
$this->productGenerator = $this->objectManager->get(ProductGenerator::class);
48-
55+
$this->websiteRepository = $this->objectManager->get(WebsiteRepository::class);
4956
$indexerRegistry = $this->objectManager->get(IndexerRegistry::class);
5057
$indexerListIds = $this->objectManager->get(Config::class)->getIndexers();
5158

@@ -79,6 +86,7 @@ public function testProductGeneration()
7986
$price = 7.99;
8087
$url = 'simple-product-url';
8188
$categoryId = 333;
89+
$secondWebsiteId = $this->websiteRepository->get('test')->getId();
8290

8391
$fixtureMap = [
8492
'name' => function () use ($name) {
@@ -96,6 +104,9 @@ public function testProductGeneration()
96104
'category_ids' => function () use ($categoryId) {
97105
return $categoryId;
98106
},
107+
'website_ids' => function () use ($secondWebsiteId) {
108+
return [1, $secondWebsiteId];
109+
}
99110
];
100111
$this->productGenerator->generate(1, $fixtureMap);
101112

setup/src/Magento/Setup/Model/FixtureGenerator/ProductGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function generate($products, $fixtureMap)
171171
],
172172
];
173173
$websiteIdsFixtures = $fixtureMap['website_ids'](1, 0);
174-
if ((is_array($websiteIdsFixtures) && count($websiteIdsFixtures) === 1) || $websiteIdsFixtures != null) {
174+
if (is_array($websiteIdsFixtures) && count($websiteIdsFixtures) === 1) {
175175
// Get website id from fixture in case when one site is assigned per product
176176
$customTableMap['catalog_product_website'] = [
177177
'fields' => [

0 commit comments

Comments
 (0)