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
GettersTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Webapi\Routing
;
7
8
use
Magento\TestModule5\Service\V1\Entity\AllSoapAndRest
;
9
10
class
GettersTest
extends
\Magento\Webapi\Routing\BaseService
11
{
15
protected
$_version
;
16
20
protected
$_restResourcePath
;
21
25
protected
$_soapService
=
'testModule5AllSoapAndRest'
;
26
27
protected
function
setUp
()
28
{
29
$this->_version =
'V1'
;
30
$this->_soapService =
"testModule5AllSoapAndRest{$this->_version}"
;
31
$this->_restResourcePath =
"/{$this->_version}/TestModule5/"
;
32
}
33
34
public
function
testGetters
()
35
{
36
$itemId = 1;
37
$serviceInfo = [
38
'rest'
=> [
39
'resourcePath'
=> $this->_restResourcePath . $itemId,
40
'httpMethod'
=>
\Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET
,
41
],
42
'soap'
=> [
43
'service'
=>
$this->_soapService
,
44
'operation'
=> $this->_soapService .
'Item'
,
45
],
46
];
47
$requestData
= [
AllSoapAndRest::ID
=> $itemId];
48
$item
= $this->
_webApiCall
($serviceInfo,
$requestData
);
49
$this->assertEquals($itemId,
$item
[
AllSoapAndRest::ID
],
'Item was retrieved unsuccessfully'
);
50
$isEnabled = isset(
$item
[
AllSoapAndRest::ENABLED
]) &&
$item
[
AllSoapAndRest::ENABLED
] ===
true
;
51
$this->assertTrue($isEnabled,
'Getter with "is" prefix is processed incorrectly.'
);
52
$hasOrder = isset(
$item
[
AllSoapAndRest::HAS_ORDERS
]) &&
$item
[
AllSoapAndRest::HAS_ORDERS
] ===
true
;
53
$this->assertTrue($hasOrder,
'Getter with "has" prefix is processed incorrectly.'
);
54
}
55
}
Magento\Webapi\Routing\GettersTest\testGetters
testGetters()
Definition:
GettersTest.php:34
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
Magento\TestModule5\Service\V1\Entity\AllSoapAndRest
Definition:
AllSoapAndRest.php:14
Magento\Webapi\Routing\GettersTest\$_soapService
$_soapService
Definition:
GettersTest.php:25
Magento\Webapi\Routing\GettersTest\$_version
$_version
Definition:
GettersTest.php:15
$item
$item
Definition:
partial_invoice.php:27
Magento\Webapi\Routing\GettersTest\$_restResourcePath
$_restResourcePath
Definition:
GettersTest.php:20
Magento\Framework\Webapi\Rest\Request\HTTP_METHOD_GET
const HTTP_METHOD_GET
Definition:
Request.php:19
Magento\TestModule5\Service\V1\Entity\AllSoapAndRest\HAS_ORDERS
const HAS_ORDERS
Definition:
AllSoapAndRest.php:26
Magento\Webapi\Routing\GettersTest
Definition:
GettersTest.php:10
Magento\Webapi\Routing\GettersTest\setUp
setUp()
Definition:
GettersTest.php:27
Magento\TestModule5\Service\V1\Entity\AllSoapAndRest\ENABLED
const ENABLED
Definition:
AllSoapAndRest.php:25
Magento\Webapi\Routing\BaseService
Definition:
BaseService.php:14
Magento\TestModule5\Service\V1\Entity\AllSoapAndRest\ID
const ID
Definition:
AllSoapAndRest.php:19