Skip to content

Commit 26597cf

Browse files
author
Oleksandr Iegorov
committed
MC-43176: GraphQL returns the price ranges of a simple product on another store
1 parent 7c0b922 commit 26597cf

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
use Magento\Catalog\Api\ProductRepositoryInterface;
8+
use Magento\Store\Api\WebsiteRepositoryInterface;
9+
use Magento\TestFramework\Helper\Bootstrap;
10+
use Magento\TestFramework\Workaround\Override\Fixture\Resolver;
11+
12+
Bootstrap::getInstance()->reinitialize();
13+
14+
Resolver::getInstance()->requireDataFixture(
15+
'Magento/ConfigurableProduct/_files/product_configurable_in_multiple_websites.php'
16+
);
17+
18+
/** @var WebsiteRepositoryInterface $repository */
19+
$repository = Bootstrap::getObjectManager()->get(WebsiteRepositoryInterface::class);
20+
$websiteId = $repository->get('test')->getId();
21+
22+
/** @var ProductRepositoryInterface $productRepository */
23+
$productRepository = Bootstrap::getObjectManager()
24+
->create(ProductRepositoryInterface::class);
25+
26+
$product = $productRepository->get('simple_20', true);
27+
$product->setWebsiteIds([$websiteId]);
28+
$product->setSpecialPrice('4');
29+
$productRepository->save($product);
30+
31+
$product = $productRepository->get('simple_10', true);
32+
$product->setWebsiteIds([1]);
33+
$productRepository->save($product);

0 commit comments

Comments
 (0)