|
10 | 10 |
|
11 | 11 | use Magento\Framework\Api\SearchCriteriaBuilder;
|
12 | 12 | use Magento\Framework\Exception\NoSuchEntityException;
|
| 13 | +use Magento\Indexer\Model\Indexer\CollectionFactory; |
13 | 14 | use Magento\InventoryApi\Api\Data\SourceItemInterface;
|
14 | 15 | use Magento\InventoryApi\Api\SourceItemRepositoryInterface;
|
15 | 16 | use Magento\InventoryInStorePickupSales\Model\SourceSelection\GetSourceItemQtyAvailableService;
|
@@ -69,78 +70,78 @@ public function testWithoutStorePickup()
|
69 | 70 | }
|
70 | 71 | }
|
71 | 72 |
|
72 |
| -// /** |
73 |
| -// * @magentoDataFixture Magento_InventorySalesApi::Test/_files/websites_with_stores.php |
74 |
| -// * @magentoDataFixture Magento_InventoryApi::Test/_files/products.php |
75 |
| -// * @magentoDataFixture Magento_InventoryApi::Test/_files/sources.php |
76 |
| -// * @magentoDataFixture Magento_InventoryApi::Test/_files/stocks.php |
77 |
| -// * @magentoDataFixture Magento_InventoryApi::Test/_files/stock_source_links.php |
78 |
| -// * @magentoDataFixture Magento_InventorySalesApi::Test/_files/stock_website_sales_channels.php |
79 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupApi::Test/_files/source_items.php |
80 |
| -// * @magentoDataFixture Magento_InventoryIndexer::Test/_files/reindex_inventory.php |
81 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupApi::Test/_files/source_addresses.php |
82 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupApi::Test/_files/source_pickup_location_attributes.php |
83 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/create_in_store_pickup_quote_on_eu_website_guest.php |
84 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/place_order.php |
85 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/set_order_pickup_location.php |
86 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/create_multiple_quotes_on_eu_website.php |
87 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/place_multiple_orders_on_eu_website.php |
88 |
| -// * |
89 |
| -// * @magentoConfigFixture store_for_eu_website_store carriers/instore/active 1 |
90 |
| -// * @magentoConfigFixture store_for_eu_website_store carriers/flatrate/active 1 |
91 |
| -// * |
92 |
| -// * @magentoDbIsolation disabled |
93 |
| -// * |
94 |
| -// * @dataProvider singleStorePickupOrderProvider |
95 |
| -// * |
96 |
| -// * @param string $sourceCode |
97 |
| -// * @param string $sku |
98 |
| -// * @param float $qtyExpected |
99 |
| -// * |
100 |
| -// * @throws NoSuchEntityException |
101 |
| -// */ |
102 |
| -// public function testSingleStorePickupOrder(string $sourceCode, string $sku, float $qtyExpected) |
103 |
| -// { |
104 |
| -// $sourceItem = $this->getSourceItem($sourceCode, $sku); |
105 |
| -// $this->assertEquals($qtyExpected, $this->getSourceItemQtyAvailableService->execute($sourceItem)); |
106 |
| -// } |
107 |
| -// |
108 |
| -// /** |
109 |
| -// * @magentoDataFixture Magento_InventorySalesApi::Test/_files/websites_with_stores.php |
110 |
| -// * @magentoDataFixture Magento_InventoryApi::Test/_files/products.php |
111 |
| -// * @magentoDataFixture Magento_InventoryApi::Test/_files/sources.php |
112 |
| -// * @magentoDataFixture Magento_InventoryApi::Test/_files/stocks.php |
113 |
| -// * @magentoDataFixture Magento_InventoryApi::Test/_files/stock_source_links.php |
114 |
| -// * @magentoDataFixture Magento_InventorySalesApi::Test/_files/stock_website_sales_channels.php |
115 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupApi::Test/_files/source_items.php |
116 |
| -// * @magentoDataFixture Magento_InventoryIndexer::Test/_files/reindex_inventory.php |
117 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupApi::Test/_files/source_addresses.php |
118 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupApi::Test/_files/source_pickup_location_attributes.php |
119 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/create_in_store_pickup_quote_on_eu_website_guest.php |
120 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/place_order.php |
121 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/set_order_pickup_location.php |
122 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/create_multiple_quotes_on_eu_website.php |
123 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/place_multiple_orders_on_eu_website.php |
124 |
| -// * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/set_orders_pickup_location.php |
125 |
| -// * |
126 |
| -// * @magentoConfigFixture store_for_eu_website_store carriers/instore/active 1 |
127 |
| -// * @magentoConfigFixture store_for_eu_website_store carriers/flatrate/active 1 |
128 |
| -// * |
129 |
| -// * @magentoDbIsolation disabled |
130 |
| -// * |
131 |
| -// * @dataProvider multipleStorePickupOrdersProvider |
132 |
| -// * |
133 |
| -// * @param string $sourceCode |
134 |
| -// * @param string $sku |
135 |
| -// * @param float $qtyExpected |
136 |
| -// * |
137 |
| -// * @throws |
138 |
| -// */ |
139 |
| -// public function testMultipleStorePickupOrders(string $sourceCode, string $sku, float $qtyExpected) |
140 |
| -// { |
141 |
| -// $sourceItem = $this->getSourceItem($sourceCode, $sku); |
142 |
| -// $this->assertEquals($qtyExpected, $this->getSourceItemQtyAvailableService->execute($sourceItem)); |
143 |
| -// } |
| 73 | + /** |
| 74 | + * @magentoDataFixture Magento_InventorySalesApi::Test/_files/websites_with_stores.php |
| 75 | + * @magentoDataFixture Magento_InventoryApi::Test/_files/products.php |
| 76 | + * @magentoDataFixture Magento_InventoryApi::Test/_files/sources.php |
| 77 | + * @magentoDataFixture Magento_InventoryApi::Test/_files/stocks.php |
| 78 | + * @magentoDataFixture Magento_InventoryApi::Test/_files/stock_source_links.php |
| 79 | + * @magentoDataFixture Magento_InventorySalesApi::Test/_files/stock_website_sales_channels.php |
| 80 | + * @magentoDataFixture Magento_InventoryInStorePickupApi::Test/_files/source_items.php |
| 81 | + * @magentoDataFixture Magento_InventoryIndexer::Test/_files/reindex_inventory.php |
| 82 | + * @magentoDataFixture Magento_InventoryInStorePickupApi::Test/_files/source_addresses.php |
| 83 | + * @magentoDataFixture Magento_InventoryInStorePickupApi::Test/_files/source_pickup_location_attributes.php |
| 84 | + * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/create_in_store_pickup_quote_on_eu_website_guest.php |
| 85 | + * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/place_order.php |
| 86 | + * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/set_order_pickup_location.php |
| 87 | + * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/create_multiple_quotes_on_eu_website.php |
| 88 | + * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/place_multiple_orders_on_eu_website.php |
| 89 | + * |
| 90 | + * @magentoConfigFixture store_for_eu_website_store carriers/instore/active 1 |
| 91 | + * @magentoConfigFixture store_for_eu_website_store carriers/flatrate/active 1 |
| 92 | + * |
| 93 | + * @magentoDbIsolation disabled |
| 94 | + * |
| 95 | + * @dataProvider singleStorePickupOrderProvider |
| 96 | + * |
| 97 | + * @param string $sourceCode |
| 98 | + * @param string $sku |
| 99 | + * @param float $qtyExpected |
| 100 | + * |
| 101 | + * @throws NoSuchEntityException |
| 102 | + */ |
| 103 | + public function testSingleStorePickupOrder(string $sourceCode, string $sku, float $qtyExpected) |
| 104 | + { |
| 105 | + $sourceItem = $this->getSourceItem($sourceCode, $sku); |
| 106 | + $this->assertEquals($qtyExpected, $this->getSourceItemQtyAvailableService->execute($sourceItem)); |
| 107 | + } |
| 108 | + |
| 109 | + /** |
| 110 | + * @magentoDataFixture Magento_InventorySalesApi::Test/_files/websites_with_stores.php |
| 111 | + * @magentoDataFixture Magento_InventoryApi::Test/_files/products.php |
| 112 | + * @magentoDataFixture Magento_InventoryApi::Test/_files/sources.php |
| 113 | + * @magentoDataFixture Magento_InventoryApi::Test/_files/stocks.php |
| 114 | + * @magentoDataFixture Magento_InventoryApi::Test/_files/stock_source_links.php |
| 115 | + * @magentoDataFixture Magento_InventorySalesApi::Test/_files/stock_website_sales_channels.php |
| 116 | + * @magentoDataFixture Magento_InventoryInStorePickupApi::Test/_files/source_items.php |
| 117 | + * @magentoDataFixture Magento_InventoryIndexer::Test/_files/reindex_inventory.php |
| 118 | + * @magentoDataFixture Magento_InventoryInStorePickupApi::Test/_files/source_addresses.php |
| 119 | + * @magentoDataFixture Magento_InventoryInStorePickupApi::Test/_files/source_pickup_location_attributes.php |
| 120 | + * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/create_in_store_pickup_quote_on_eu_website_guest.php |
| 121 | + * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/place_order.php |
| 122 | + * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/set_order_pickup_location.php |
| 123 | + * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/create_multiple_quotes_on_eu_website.php |
| 124 | + * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/place_multiple_orders_on_eu_website.php |
| 125 | + * @magentoDataFixture Magento_InventoryInStorePickupSalesApi::Test/_files/set_orders_pickup_location.php |
| 126 | + * |
| 127 | + * @magentoConfigFixture store_for_eu_website_store carriers/instore/active 1 |
| 128 | + * @magentoConfigFixture store_for_eu_website_store carriers/flatrate/active 1 |
| 129 | + * |
| 130 | + * @magentoDbIsolation disabled |
| 131 | + * |
| 132 | + * @dataProvider multipleStorePickupOrdersProvider |
| 133 | + * |
| 134 | + * @param string $sourceCode |
| 135 | + * @param string $sku |
| 136 | + * @param float $qtyExpected |
| 137 | + * |
| 138 | + * @throws |
| 139 | + */ |
| 140 | + public function testMultipleStorePickupOrders(string $sourceCode, string $sku, float $qtyExpected) |
| 141 | + { |
| 142 | + $sourceItem = $this->getSourceItem($sourceCode, $sku); |
| 143 | + $this->assertEquals($qtyExpected, $this->getSourceItemQtyAvailableService->execute($sourceItem)); |
| 144 | + } |
144 | 145 |
|
145 | 146 | /**
|
146 | 147 | * @param string $sourceCodes
|
@@ -217,4 +218,17 @@ private function getSourceItem(string $sourceCode, $sku): SourceItemInterface
|
217 | 218 | )->getItems()
|
218 | 219 | );
|
219 | 220 | }
|
| 221 | + |
| 222 | + /** |
| 223 | + * @inheritdoc |
| 224 | + */ |
| 225 | + public static function tearDownAfterClass(): void |
| 226 | + { |
| 227 | + $indexerCollectionFactory = Bootstrap::getObjectManager()->create(CollectionFactory::class); |
| 228 | + $indexerCollection = $indexerCollectionFactory->create(); |
| 229 | + |
| 230 | + foreach ($indexerCollection as $indexer) { |
| 231 | + $indexer->reindexAll(); |
| 232 | + } |
| 233 | + } |
220 | 234 | }
|
0 commit comments