Skip to content

Commit 01c935d

Browse files
author
vnayda
committed
MAGETWO-59953: [Backport] Configurable product option price is displayed incorrectly per website for 2.1.3
- integration tests
1 parent 69ee309 commit 01c935d

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/ConfigurableTest.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,40 @@ public function testGetProductFinalPriceIfOneOfChildIsDisabled()
6767
->getFirstItem();
6868
$this->assertEquals(20, $configurableProduct->getMinimalPrice());
6969
}
70+
71+
/**
72+
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
73+
*/
74+
public function testGetProductFinalPriceIfOneOfChildIsDisabledPerStore()
75+
{
76+
/** @var Collection $collection */
77+
$collection = Bootstrap::getObjectManager()->get(CollectionFactory::class)
78+
->create();
79+
$configurableProduct = $collection
80+
->addIdFilter([1])
81+
->addMinimalPrice()
82+
->load()
83+
->getFirstItem();
84+
$this->assertEquals(10, $configurableProduct->getMinimalPrice());
85+
86+
$childProduct = $this->productRepository->getById(10, false, null, true);
87+
$childProduct->setStatus(Status::STATUS_DISABLED);
88+
89+
// update in default store scope
90+
$currentStoreId = $this->storeManager->getStore()->getId();
91+
$defaultStore = $this->storeManager->getDefaultStoreView();
92+
$this->storeManager->setCurrentStore($defaultStore->getId());
93+
$this->productRepository->save($childProduct);
94+
$this->storeManager->setCurrentStore($currentStoreId);
95+
96+
/** @var Collection $collection */
97+
$collection = Bootstrap::getObjectManager()->get(CollectionFactory::class)
98+
->create();
99+
$configurableProduct = $collection
100+
->addIdFilter([1])
101+
->addMinimalPrice()
102+
->load()
103+
->getFirstItem();
104+
$this->assertEquals(20, $configurableProduct->getMinimalPrice());
105+
}
70106
}

dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function testGetProductsIfOneOfChildIsDisabled()
7171
/**
7272
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
7373
*/
74-
public function testGetProductsIfOneOfChildIsDisabledPerWebsite()
74+
public function testGetProductsIfOneOfChildIsDisabledPerStore()
7575
{
7676
$configurableProduct = $this->productRepository->getById(1, false, null, true);
7777
$lowestPriceChildrenProducts = $this->lowestPriceOptionsProvider->getProducts($configurableProduct);

0 commit comments

Comments
 (0)