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
Sales
Service
V1
InvoiceVoidTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Sales\Service\V1
;
8
9
use
Magento\TestFramework\TestCase\WebapiAbstract
;
10
14
class
InvoiceVoidTest
extends
WebapiAbstract
15
{
16
const
SERVICE_VERSION
=
'V1'
;
17
18
const
SERVICE_NAME
=
'salesInvoiceManagementV1'
;
19
24
public
function
testInvoiceVoid()
25
{
26
$objectManager
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
();
28
$invoice
=
$objectManager
->get(\
Magento
\Sales\Model\
Order
\Invoice::class)->loadByIncrementId(
'100000001'
);
29
$serviceInfo = [
30
'rest'
=> [
31
'resourcePath'
=>
'/V1/invoices/'
.
$invoice
->getId() .
'/void'
,
32
'httpMethod'
=>
\Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST
,
33
],
34
'soap'
=> [
35
'service'
=>
self::SERVICE_NAME
,
36
'serviceVersion'
=>
self::SERVICE_VERSION
,
37
'operation'
=> self::SERVICE_NAME .
'setVoid'
,
38
],
39
];
40
$requestData
= [
'id'
=>
$invoice
->getId()];
41
$this->
_webApiCall
($serviceInfo,
$requestData
);
42
}
43
}
Magento\Sales\Model\Order
Definition:
Order.php:54
$requestData
$requestData
Definition:
order_configurable_product.php:31
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\TestFramework\TestCase\WebapiAbstract\_webApiCall
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)
Definition:
WebapiAbstract.php:165
Magento\Sales\Service\V1
Definition:
CreditmemoAddCommentTest.php:6
Magento\Sales\Service\V1\InvoiceVoidTest\SERVICE_VERSION
const SERVICE_VERSION
Definition:
InvoiceVoidTest.php:16
$invoice
$invoice
Definition:
partial_invoice.php:22
Magento\Framework\Webapi\Rest\Request\HTTP_METHOD_POST
const HTTP_METHOD_POST
Definition:
Request.php:22
Magento
Magento\Sales\Service\V1\InvoiceVoidTest
Definition:
InvoiceVoidTest.php:14
Magento\TestFramework\TestCase\WebapiAbstract
Definition:
WebapiAbstract.php:19
Magento\Sales\Service\V1\InvoiceVoidTest\SERVICE_NAME
const SERVICE_NAME
Definition:
InvoiceVoidTest.php:18
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125