Skip to content

Commit 49f157b

Browse files
committed
Fix inventory test
1 parent 2321889 commit 49f157b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/unit/services/InventoryTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ public function _fixtures(): array
4848
public function testUpdatePurchasableInventoryLevel(array $updateConfigs, int $expected): void
4949
{
5050
$variant = Variant::find()->sku('rad-hood')->one();
51+
$originalInventoryTracked = $variant->inventoryTracked;
52+
$variant->inventoryTracked = true;
5153
$originalStock = $variant->getStock();
5254

5355
foreach ($updateConfigs as $updateConfig) {
@@ -60,6 +62,7 @@ public function testUpdatePurchasableInventoryLevel(array $updateConfigs, int $e
6062
self::assertEquals($expected, $variant->getStock());
6163

6264
Plugin::getInstance()->getInventory()->updatePurchasableInventoryLevel($variant, $originalStock);
65+
$variant->inventoryTracked = $originalInventoryTracked;
6366
}
6467

6568
/**

0 commit comments

Comments
 (0)