6 declare(strict_types=1);
19 use PHPUnit\Framework\TestCase;
26 private $getProductSalableQty;
31 private $productRepository;
36 private $stockRepository;
41 private $websiteRepository;
46 private $reservationBuilder;
51 private $appendReservations;
56 private $cleanupReservations;
61 private $stockManagement;
80 $this->cleanupReservations->execute();
97 self::assertEquals(8.5, $this->getProductSalableQty->execute(
'SKU-1', 10));
99 $product = $this->productRepository->get(
'SKU-1');
100 $website = $this->websiteRepository->get(
'eu_website');
101 $this->stockManagement->backItemQty(
$product->getId(), 3.5,
$website->getId());
103 self::assertEquals(12, $this->getProductSalableQty->execute(
'SKU-1', 10));
105 $this->appendReservations->execute([
107 $this->reservationBuilder->setStockId(10)->setSku(
'SKU-1')->setQuantity(-3.5)->build(),
static getObjectManager()