6 declare(strict_types=1);
15 use PHPUnit\Framework\TestCase;
27 private $productRepository;
32 private $storeManager;
37 private $storeCodeBefore;
49 $this->storeCodeBefore = $this->storeManager->getStore()->getCode();
69 $this->storeManager->setCurrentStore(
$storeCode);
72 $product = $this->productRepository->get($sku);
74 $this->stockHelper->assignStatusToProduct(
$product);
76 self::assertEquals($expectedStatus,
$product->isSalable());
98 $this->storeManager->setCurrentStore(
$storeCode);
101 $product = $this->productRepository->get($sku);
103 $this->stockHelper->assignStatusToProduct(
$product, $expectedStatus);
105 self::assertEquals($expectedStatus,
$product->isSalable());
116 'store_for_eu_website',
124 'store_for_us_website',
131 'global_website' => [
132 'store_for_global_website',
147 $this->storeManager->setCurrentStore($this->storeCodeBefore);
assignStatusToProductDataProvider()
static getObjectManager()