6 declare(strict_types=1);
15 use PHPUnit\Framework\TestCase;
22 private $reservationBuilder;
27 private $appendReservations;
32 private $cleanupReservations;
37 private $getProductSalableQty;
45 GetProductSalableQtyInterface::class
54 $this->cleanupReservations->execute();
75 self::assertEquals($qty, $this->getProductSalableQty->execute($sku, $stockId));
108 $this->appendReservations->execute([
110 $this->reservationBuilder->setStockId(10)->setSku(
'SKU-1')->setQuantity(-5)->build(),
112 $this->reservationBuilder->setStockId(10)->setSku(
'SKU-1')->setQuantity(1.5)->build(),
114 self::assertEquals(5, $this->getProductSalableQty->execute(
'SKU-1', 10));
116 $this->appendReservations->execute([
118 $this->reservationBuilder->setStockId(10)->setSku(
'SKU-1')->setQuantity(3.5)->build(),
getProductQuantityProvider()
testGetProductQuantity(string $sku, int $stockId, float $qty)
testGetProductQuantityIfReservationsArePresent()
static getObjectManager()