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
magento2-base
dev
tests
api-functional
testsuite
Magento
Webapi
Routing
SubsetTest.php
Go to the documentation of this file.
1
<?php
10
namespace
Magento\Webapi\Routing
;
11
12
class
SubsetTest
extends
\Magento\Webapi\Routing\BaseService
13
{
17
protected
$_version
;
18
22
protected
$_restResourcePath
;
23
27
protected
$_soapService
;
28
32
protected
function
setUp
()
33
{
34
$this->_version =
'V1'
;
35
$this->_restResourcePath =
"/{$this->_version}/testModule2SubsetRest/"
;
36
$this->_soapService =
'testModule2SubsetRestV1'
;
37
}
38
43
public
function
testItem
()
44
{
45
$itemId = 1;
46
$serviceInfo = [
47
'rest'
=> [
48
'resourcePath'
=> $this->_restResourcePath . $itemId,
49
'httpMethod'
=>
\Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET
,
50
],
51
'soap'
=> [
'service'
=>
$this->_soapService
,
'operation'
=> $this->_soapService .
'Item'
],
52
];
53
$requestData
= [
'id'
=> $itemId];
54
$item
= $this->
_webApiCall
($serviceInfo,
$requestData
);
55
$this->assertEquals($itemId,
$item
[
'id'
],
'Item was retrieved unsuccessfully'
);
56
}
57
62
public
function
testItems
()
63
{
64
$itemArr = [[
'id'
=> 1,
'name'
=>
'testItem1'
], [
'id'
=> 2,
'name'
=>
'testItem2'
]];
65
$serviceInfo = [
66
'rest'
=> [
67
'resourcePath'
=>
$this->_restResourcePath
,
68
'httpMethod'
=>
\Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET
,
69
],
70
'soap'
=> [
'service'
=>
$this->_soapService
,
'operation'
=> $this->_soapService .
'Items'
],
71
];
72
73
$item
= $this->
_webApiCall
($serviceInfo);
74
$this->assertEquals($itemArr,
$item
,
'Items were not retrieved'
);
75
}
76
}
Magento\Webapi\Routing
Definition:
BaseService.php:6
$requestData
$requestData
Definition:
order_configurable_product.php:31
Magento\TestFramework\TestCase\WebapiAbstract\_webApiCall
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)
Definition:
WebapiAbstract.php:165
$item
$item
Definition:
partial_invoice.php:27
Magento\Webapi\Routing\SubsetTest\setUp
setUp()
Definition:
SubsetTest.php:32
Magento\Framework\Webapi\Rest\Request\HTTP_METHOD_GET
const HTTP_METHOD_GET
Definition:
Request.php:19
Magento\Webapi\Routing\SubsetTest\$_soapService
$_soapService
Definition:
SubsetTest.php:27
Magento\Webapi\Routing\SubsetTest
Definition:
SubsetTest.php:12
Magento\Webapi\Routing\SubsetTest\$_version
$_version
Definition:
SubsetTest.php:17
Magento\Webapi\Routing\BaseService
Definition:
BaseService.php:14
Magento\Webapi\Routing\SubsetTest\testItem
testItem()
Definition:
SubsetTest.php:43
Magento\Webapi\Routing\SubsetTest\testItems
testItems()
Definition:
SubsetTest.php:62
Magento\Webapi\Routing\SubsetTest\$_restResourcePath
$_restResourcePath
Definition:
SubsetTest.php:22