Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
OrderCancelTest.php
Go to the documentation of this file.
1 <?php
8 
10 
12 {
13  const SERVICE_VERSION = 'V1';
14 
15  const SERVICE_NAME = 'salesOrderManagementV1';
16 
20  public function testOrderCancel()
21  {
23  $order = $objectManager->get(\Magento\Sales\Model\Order::class)->loadByIncrementId('100000001');
24  $serviceInfo = [
25  'rest' => [
26  'resourcePath' => '/V1/orders/' . $order->getId() . '/cancel',
28  ],
29  'soap' => [
30  'service' => self::SERVICE_NAME,
31  'serviceVersion' => self::SERVICE_VERSION,
32  'operation' => self::SERVICE_NAME . 'cancel',
33  ],
34  ];
35  $requestData = ['id' => $order->getId()];
36  $result = $this->_webApiCall($serviceInfo, $requestData);
37  $this->assertTrue($result);
38  }
39 }
$objectManager
Definition: bootstrap.php:17
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)
$order
Definition: order.php:55