Skip to content

Commit 28b5d9d

Browse files
#7720: improve integration test fix
1 parent 347001f commit 28b5d9d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/MultiStoreConfigurableViewOnProductPageTest.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Magento\Store\Model\StoreManagerInterface;
1818
use Magento\TestFramework\Helper\Bootstrap;
1919
use Magento\TestFramework\Store\ExecuteInStoreContext;
20-
use Magento\Store\Api\StoreRepositoryInterface;
2120
use PHPUnit\Framework\TestCase;
2221

2322
/**
@@ -48,9 +47,6 @@ class MultiStoreConfigurableViewOnProductPageTest extends TestCase
4847
/** @var ExecuteInStoreContext */
4948
private $executeInStoreContext;
5049

51-
/** @var StoreRepositoryInterface */
52-
private $storeRepository;
53-
5450
/**
5551
* @inheritdoc
5652
*/
@@ -66,7 +62,6 @@ protected function setUp()
6662
$this->serializer = $this->objectManager->get(SerializerInterface::class);
6763
$this->productResource = $this->objectManager->get(ProductResource::class);
6864
$this->executeInStoreContext = $this->objectManager->get(ExecuteInStoreContext::class);
69-
$this->storeRepository = $this->objectManager->get(StoreRepositoryInterface::class);
7065
}
7166

7267
/**
@@ -187,10 +182,10 @@ public function assertProductConfig($expectedProducts): void
187182
*/
188183
private function prepareConfigurableProduct(string $sku, string $storeCode): void
189184
{
190-
$storeId = $this->storeRepository->get($storeCode)->getId();
185+
$store = $this->storeManager->getStore($storeCode);
191186
$product = $this->productRepository->get($sku, false, null, true);
192187
$productToUpdate = $product->getTypeInstance()->getUsedProductCollection($product)
193-
->addStoreFilter($storeId)->setPageSize(1)->getFirstItem();
188+
->addStoreFilter($store)->setPageSize(1)->getFirstItem();
194189

195190
$this->assertNotEmpty($productToUpdate->getData(), 'Configurable product does not have a child');
196191
$this->executeInStoreContext->execute($storeCode, [$this, 'setProductDisabled'], $productToUpdate);

0 commit comments

Comments
 (0)