|
12 | 12 | use Magento\Catalog\Model\Product;
|
13 | 13 | use Magento\Eav\Model\Config;
|
14 | 14 | use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
|
| 15 | +use Magento\Framework\Module\Manager; |
15 | 16 | use Magento\Framework\ObjectManagerInterface;
|
16 | 17 | use Magento\Store\Model\StoreManagerInterface;
|
17 | 18 | use Magento\TestFramework\Helper\Bootstrap;
|
@@ -84,18 +85,24 @@ public function testMapSelectAttributeWithDifferentStoreLabels(): void
|
84 | 85 | $productId => [
|
85 | 86 | 'store_id' => $defaultStore->getId(),
|
86 | 87 | 'select_attribute' => (int)$attributeValue,
|
87 |
| - 'select_attribute_value' => 'Table_default', |
88 |
| - 'is_out_of_stock' => 1 |
| 88 | + 'select_attribute_value' => 'Table_default' |
89 | 89 | ],
|
90 | 90 | ];
|
91 | 91 | $secondStoreMap = [
|
92 | 92 | $productId => [
|
93 | 93 | 'store_id' => $secondStore->getId(),
|
94 | 94 | 'select_attribute' => (int)$attributeValue,
|
95 |
| - 'select_attribute_value' => 'Table_fixture_second_store', |
96 |
| - 'is_out_of_stock' => 1 |
| 95 | + 'select_attribute_value' => 'Table_fixture_second_store' |
97 | 96 | ],
|
98 | 97 | ];
|
| 98 | + |
| 99 | + /** @var Manager $moduleManager */ |
| 100 | + $moduleManager = $this->objectManager->get(Manager::class); |
| 101 | + if ($moduleManager->isEnabled('Magento_InventoryElasticsearch')) { |
| 102 | + $defaultStoreMap[$productId] += ['is_out_of_stock' => 1]; |
| 103 | + $secondStoreMap[$productId] += ['is_out_of_stock' => 1]; |
| 104 | + } |
| 105 | + |
99 | 106 | $data = [
|
100 | 107 | $productId => [
|
101 | 108 | $attributeId => $attributeValue,
|
|
0 commit comments