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
Test
Integration
GetSourceCodesBySkusTest.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\Inventory\Test\Integration
;
9
10
use
Magento\InventoryApi\Model\GetSourceCodesBySkusInterface
;
11
use
Magento\TestFramework\Helper\Bootstrap
;
12
use PHPUnit\Framework\TestCase;
13
14
class
GetSourceCodesBySkusTest
extends
TestCase
15
{
19
private
$getSourceCodesBySkus;
20
21
protected
function
setUp
()
22
{
23
parent::setUp();
24
25
$this->getSourceCodesBySkus =
Bootstrap::getObjectManager
()->get(GetSourceCodesBySkusInterface::class);
26
}
27
33
public
function
testExecute
()
34
{
35
$sourceCodes = $this->getSourceCodesBySkus->execute([
'SKU-1'
]);
36
37
self::assertContains(
'eu-1'
, $sourceCodes);
38
self::assertContains(
'eu-2'
, $sourceCodes);
39
self::assertContains(
'eu-3'
, $sourceCodes);
40
self::assertContains(
'eu-disabled'
, $sourceCodes);
41
self::assertNotContains(
'us-1'
, $sourceCodes);
42
43
$sourceCodes = $this->getSourceCodesBySkus->execute([
'SKU-1'
,
'SKU-2'
,
'SKU-3'
]);
44
self::assertContains(
'us-1'
, $sourceCodes);
45
}
46
}
Magento\Inventory\Test\Integration\GetSourceCodesBySkusTest\testExecute
testExecute()
Definition:
GetSourceCodesBySkusTest.php:33
Magento\Inventory\Test\Integration
Definition:
GetSourceCodesBySkusTest.php:8
Magento\TestFramework\Helper\Bootstrap
Definition:
Bootstrap.php:12
Magento\Inventory\Test\Integration\GetSourceCodesBySkusTest\setUp
setUp()
Definition:
GetSourceCodesBySkusTest.php:21
Magento\InventoryApi\Model\GetSourceCodesBySkusInterface
Definition:
GetSourceCodesBySkusInterface.php:14
Magento\Inventory\Test\Integration\GetSourceCodesBySkusTest
Definition:
GetSourceCodesBySkusTest.php:14
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125