@@ -157,12 +157,15 @@ public function testImportWithBackordersDisabled(): void
157
157
*/
158
158
public function testProductStockStatusShouldBeUpdated ()
159
159
{
160
+ $ this ->stockRegistryStorage ->clean ();
160
161
$ status = $ this ->stockRegistry ->getStockStatusBySku ('simple ' );
161
162
$ this ->assertEquals (Stock::STOCK_IN_STOCK , $ status ->getStockStatus ());
162
163
$ this ->importFile ('disable_product.csv ' );
164
+ $ this ->stockRegistryStorage ->clean ();
163
165
$ status = $ this ->stockRegistry ->getStockStatusBySku ('simple ' );
164
166
$ this ->assertEquals (Stock::STOCK_OUT_OF_STOCK , $ status ->getStockStatus ());
165
167
$ this ->importDataForMediaTest ('enable_product.csv ' );
168
+ $ this ->stockRegistryStorage ->clean ();
166
169
$ status = $ this ->stockRegistry ->getStockStatusBySku ('simple ' );
167
170
$ this ->assertEquals (Stock::STOCK_IN_STOCK , $ status ->getStockStatus ());
168
171
}
@@ -177,17 +180,19 @@ public function testProductStockStatusShouldBeUpdated()
177
180
*/
178
181
public function testProductStockStatusShouldBeUpdatedOnSchedule ()
179
182
{
180
- /** * @var $indexProcessor \Magento\Indexer\Model\Processor */
181
183
$ indexProcessor = $ this ->objectManager ->create (\Magento \Indexer \Model \Processor::class);
182
184
$ indexProcessor ->updateMview ();
185
+ $ this ->stockRegistryStorage ->clean ();
183
186
$ status = $ this ->stockRegistry ->getStockStatusBySku ('simple ' );
184
187
$ this ->assertEquals (Stock::STOCK_IN_STOCK , $ status ->getStockStatus ());
185
188
$ this ->importDataForMediaTest ('disable_product.csv ' );
186
189
$ indexProcessor ->updateMview ();
190
+ $ this ->stockRegistryStorage ->clean ();
187
191
$ status = $ this ->stockRegistry ->getStockStatusBySku ('simple ' );
188
192
$ this ->assertEquals (Stock::STOCK_OUT_OF_STOCK , $ status ->getStockStatus ());
189
193
$ this ->importDataForMediaTest ('enable_product.csv ' );
190
194
$ indexProcessor ->updateMview ();
195
+ $ this ->stockRegistryStorage ->clean ();
191
196
$ status = $ this ->stockRegistry ->getStockStatusBySku ('simple ' );
192
197
$ this ->assertEquals (Stock::STOCK_IN_STOCK , $ status ->getStockStatus ());
193
198
}
0 commit comments