Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-inventory-sales
Test
Integration
GetStockItemData
ManageConfigConditionTest.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventorySales\Test\Integration\GetStockItemData
;
9
10
use
Magento\InventorySalesApi\Model\GetStockItemDataInterface
;
11
use
Magento\TestFramework\Helper\Bootstrap
;
12
use PHPUnit\Framework\TestCase;
13
14
class
ManageConfigConditionTest
extends
TestCase
15
{
19
private
$getStockItemData;
20
24
protected
function
setUp
()
25
{
26
parent::setUp();
27
28
$this->getStockItemData =
Bootstrap::getObjectManager
()->get(GetStockItemDataInterface::class);
29
}
30
49
public
function
testExecuteWithManageStockFalse
(
string
$sku,
int
$stockId, $expectedData)
50
{
51
$stockItemData = $this->getStockItemData->execute($sku, $stockId);
52
53
self::assertEquals($expectedData, $stockItemData);
54
}
55
59
public
function
executeWithManageStockFalseDataProvider
(): array
60
{
61
return
[
62
[
'SKU-1'
, 10, [
GetStockItemDataInterface::QUANTITY
=> 8.5,
GetStockItemDataInterface::IS_SALABLE
=> 1]],
63
[
'SKU-1'
, 20,
null
],
64
[
'SKU-1'
, 30, [
GetStockItemDataInterface::QUANTITY
=> 8.5,
GetStockItemDataInterface::IS_SALABLE
=> 1]],
65
[
'SKU-2'
, 10,
null
],
66
[
'SKU-2'
, 20, [
GetStockItemDataInterface::QUANTITY
=> 5,
GetStockItemDataInterface::IS_SALABLE
=> 1]],
67
[
'SKU-2'
, 30, [
GetStockItemDataInterface::QUANTITY
=> 5,
GetStockItemDataInterface::IS_SALABLE
=> 1]],
68
[
'SKU-3'
, 10, [
GetStockItemDataInterface::QUANTITY
=> 0,
GetStockItemDataInterface::IS_SALABLE
=> 1]],
69
[
'SKU-3'
, 20,
null
],
70
[
'SKU-3'
, 30, [
GetStockItemDataInterface::QUANTITY
=> 0,
GetStockItemDataInterface::IS_SALABLE
=> 1]],
71
];
72
}
73
}
Magento\TestFramework\Helper\Bootstrap
Definition:
Bootstrap.php:12
Magento\InventorySales\Test\Integration\GetStockItemData\ManageConfigConditionTest
Definition:
ManageConfigConditionTest.php:14
Magento\InventorySales\Test\Integration\GetStockItemData\ManageConfigConditionTest\setUp
setUp()
Definition:
ManageConfigConditionTest.php:24
Magento\InventorySalesApi\Model\GetStockItemDataInterface\QUANTITY
const QUANTITY
Definition:
GetStockItemDataInterface.php:23
Magento\InventorySales\Test\Integration\GetStockItemData\ManageConfigConditionTest\testExecuteWithManageStockFalse
testExecuteWithManageStockFalse(string $sku, int $stockId, $expectedData)
Definition:
ManageConfigConditionTest.php:49
Magento\InventorySalesApi\Model\GetStockItemDataInterface
Definition:
GetStockItemDataInterface.php:17
Magento\InventorySalesApi\Model\GetStockItemDataInterface\IS_SALABLE
const IS_SALABLE
Definition:
GetStockItemDataInterface.php:24
Magento\InventorySales\Test\Integration\GetStockItemData\ManageConfigConditionTest\executeWithManageStockFalseDataProvider
executeWithManageStockFalseDataProvider()
Definition:
ManageConfigConditionTest.php:59
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125
Magento\InventorySales\Test\Integration\GetStockItemData
Definition:
BackorderConditionTest.php:8