Skip to content

Commit 3baf405

Browse files
committed
ACP2E-3879: [Mainline] Layered Navigation display options assigned to other stores (or not assigned)
- Initial commit with test cases
1 parent 43d6992 commit 3baf405

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

app/code/Magento/ConfigurableProduct/Plugin/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider/GetProductChildIds.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
namespace Magento\ConfigurableProduct\Plugin\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider;
99

10-
use Magento\CatalogInventory\Api\StockConfigurationInterface;
1110
use Magento\Catalog\Api\ProductRepositoryInterface;
1211
use Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider;
1312
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
@@ -25,11 +24,6 @@ class GetProductChildIds
2524
*/
2625
private $storeManager;
2726

28-
/**
29-
* @var StockConfigurationInterface
30-
*/
31-
private $stockConfiguration;
32-
3327
/**
3428
* @var GetStoreSpecificProductChildIds
3529
*/
@@ -42,18 +36,15 @@ class GetProductChildIds
4236

4337
/**
4438
* @param StoreManagerInterface $storeManager
45-
* @param StockConfigurationInterface $stockConfiguration
4639
* @param GetStoreSpecificProductChildIds $getChildProductFromStoreId
4740
* @param ProductRepositoryInterface $productRepository
4841
*/
4942
public function __construct(
5043
StoreManagerInterface $storeManager,
51-
StockConfigurationInterface $stockConfiguration,
5244
GetStoreSpecificProductChildIds $getChildProductFromStoreId,
5345
ProductRepositoryInterface $productRepository
5446
) {
5547
$this->storeManager = $storeManager;
56-
$this->stockConfiguration = $stockConfiguration;
5748
$this->getChildProductFromStoreId = $getChildProductFromStoreId;
5849
$this->productRepository = $productRepository;
5950
}
@@ -75,8 +66,7 @@ public function beforePrepareProductIndex(
7566
array $productData,
7667
int $storeId
7768
) {
78-
if (!$this->stockConfiguration->isShowOutOfStock($storeId) &&
79-
Configurable::TYPE_CODE === $productData['type_id']) {
69+
if (Configurable::TYPE_CODE === $productData['type_id']) {
8070
$websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();
8171
$product = $this->productRepository->getById($productData['entity_id']);
8272

app/code/Magento/ConfigurableProduct/Test/Unit/Model/Plugin/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider/GetProductChildIdsTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
use Magento\Catalog\Api\ProductRepositoryInterface;
1111
use Magento\Catalog\Model\Product;
12-
use Magento\CatalogInventory\Api\StockConfigurationInterface;
1312
use Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider;
1413
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
1514
use Magento\ConfigurableProduct\Model\ResourceModel\Product\GetStoreSpecificProductChildIds;
@@ -28,11 +27,6 @@ class GetProductChildIdsTest extends TestCase
2827
*/
2928
private $storeManagerMock;
3029

31-
/**
32-
* @var StockConfigurationInterface|MockObject
33-
*/
34-
private $stockConfigurationMock;
35-
3630
/**
3731
* @var GetStoreSpecificProductChildIds|MockObject
3832
*/
@@ -51,7 +45,6 @@ class GetProductChildIdsTest extends TestCase
5145
protected function setUp(): void
5246
{
5347
$this->storeManagerMock = $this->createMock(StoreManagerInterface::class);
54-
$this->stockConfigurationMock = $this->createMock(StockConfigurationInterface::class);
5548
$this->getChildProductFromStoreIdMock = $this->createMock(GetStoreSpecificProductChildIds::class);
5649
$this->productRepositoryMock = $this->getMockBuilder(ProductRepositoryInterface::class)
5750
->disableOriginalConstructor()
@@ -60,7 +53,6 @@ protected function setUp(): void
6053

6154
$this->plugin = new GetProductChildIds(
6255
$this->storeManagerMock,
63-
$this->stockConfigurationMock,
6456
$this->getChildProductFromStoreIdMock,
6557
$this->productRepositoryMock
6658
);
@@ -97,11 +89,6 @@ public function testBeforePrepareProductIndexWithChildProductVisibilityAndWebsit
9789
->with($storeId)
9890
->willReturn($storeMock);
9991

100-
$this->stockConfigurationMock->expects($this->once())
101-
->method('isShowOutOfStock')
102-
->with($storeId)
103-
->willReturn(false);
104-
10592
$productMock = $this->createMock(Product::class);
10693
$productMock->expects($this->any())
10794
->method('isVisibleInSiteVisibility')

0 commit comments

Comments
 (0)