Skip to content

Commit 85a3c03

Browse files
authored
Multisource inventory test fix (#699)
1 parent 51913f3 commit 85a3c03

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

app/code/Meta/Catalog/Test/Unit/Model/Product/Feed/Builder/MultiSourceInventoryTest.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
require_once __DIR__ . "/../../../../../../Model/Product/Feed/Builder/InventoryInterface.php";
2424
require_once __DIR__ . "/../../../../../../Model/Product/Feed/Builder/MultiSourceInventory.php";
2525
require_once __DIR__ . "/../../../../../../../BusinessExtension/Model/System/Config.php";
26+
require_once __DIR__ . "/../../../../../../../BusinessExtension/Helper/FBEHelper.php";
2627

2728

2829
use Magento\Catalog\Model\Product;
@@ -35,10 +36,15 @@
3536
use Magento\InventorySalesApi\Model\StockByWebsiteIdResolverInterface;
3637
use Magento\Store\Model\Store;
3738
use Meta\BusinessExtension\Model\System\Config as SystemConfig;
39+
use Meta\BusinessExtension\Helper\FBEHelper;
3840
use Meta\Catalog\Model\Product\Feed\Builder\InventoryInterface;
3941
use Meta\Catalog\Model\Product\Feed\Builder\MultiSourceInventory;
4042
use PHPUnit\Framework\TestCase;
4143

44+
/**
45+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
46+
*/
47+
4248
class MultiSourceInventoryTest extends TestCase
4349
{
4450
/**
@@ -66,6 +72,11 @@ class MultiSourceInventoryTest extends TestCase
6672
*/
6773
private $getProductSalableQtyInterface;
6874

75+
/**
76+
* @var FBEHelper
77+
*/
78+
private $fbeHelper;
79+
6980
/**
7081
* Used to set the values before running a test
7182
*
@@ -77,20 +88,24 @@ public function setUp(): void
7788
$this->isProductSalableInterface = $this->createStub(IsProductSalableInterface::class);
7889
$this->stockByWebsiteIdResolver = $this->createStub(StockByWebsiteIdResolverInterface::class);
7990
$this->getProductSalableQtyInterface = $this->createStub(GetProductSalableQtyInterface::class);
91+
$this->fbeHelper = $this->createStub(FBEHelper::class);
8092

8193
$getStockItemConfiguration = $this->createStub(GetStockItemConfigurationInterface::class);
8294
$stockItemRepository = $this->createStub(StockItemRepositoryInterface::class);
8395
$stockItemCriteriaInterfaceFactory = $this->createStub(StockItemCriteriaInterfaceFactory::class);
8496

8597
$this->inventory = $this->getMockBuilder(MultiSourceInventory::class)
8698
->enableOriginalConstructor()
87-
->setConstructorArgs([$this->isProductSalableInterface,
99+
->setConstructorArgs([
100+
$this->isProductSalableInterface,
88101
$this->getProductSalableQtyInterface,
89102
$this->systemConfig,
90103
$this->stockByWebsiteIdResolver,
91104
$getStockItemConfiguration,
92105
$stockItemRepository,
93-
$stockItemCriteriaInterfaceFactory])
106+
$stockItemCriteriaInterfaceFactory,
107+
$this->fbeHelper
108+
])
94109
->onlyMethods(['isInStock', 'getStockQty', 'isStockManagedForProduct'])
95110
->getMock();
96111
}

0 commit comments

Comments
 (0)