Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
OrderGetStatusTest.php
Go to the documentation of this file.
1 <?php
7 
9 
15 {
16  const RESOURCE_PATH = '/V1/orders/%d/statuses';
17 
18  const SERVICE_READ_NAME = 'salesOrderManagementV1';
19 
20  const SERVICE_VERSION = 'V1';
21 
22  const ORDER_INCREMENT_ID = '100000001';
23 
27  protected $objectManager;
28 
29  protected function setUp()
30  {
32  }
33 
37  public function testOrderGetStatus()
38  {
40  $order = $this->objectManager->create(\Magento\Sales\Model\Order::class);
41  $order->loadByIncrementId(self::ORDER_INCREMENT_ID);
42 
43  $serviceInfo = [
44  'rest' => [
45  'resourcePath' => sprintf(self::RESOURCE_PATH, $order->getId()),
46  'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET,
47  ],
48  'soap' => [
49  'service' => self::SERVICE_READ_NAME,
50  'serviceVersion' => self::SERVICE_VERSION,
51  'operation' => self::SERVICE_READ_NAME . 'getStatus',
52  ],
53  ];
54 
55  $this->assertEquals($order->getStatus(), $this->_webApiCall($serviceInfo, ['id' => $order->getId()]));
56  }
57 }
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)
$order
Definition: order.php:55