Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ShipmentEmailTest.php
Go to the documentation of this file.
1 <?php
8 
10 
15 {
16  const SERVICE_VERSION = 'V1';
17 
18  const SERVICE_NAME = 'salesShipmentManagementV1';
19 
23  public function testShipmentEmail()
24  {
26  $shipmentCollection = $objectManager->get(\Magento\Sales\Model\ResourceModel\Order\Shipment\Collection::class);
27  $shipment = $shipmentCollection->getFirstItem();
28  $serviceInfo = [
29  'rest' => [
30  'resourcePath' => '/V1/shipment/' . $shipment->getId() . '/emails',
32  ],
33  'soap' => [
34  'service' => self::SERVICE_NAME,
35  'serviceVersion' => self::SERVICE_VERSION,
36  'operation' => self::SERVICE_NAME . 'notify',
37  ],
38  ];
39  $requestData = ['id' => $shipment->getId()];
40  $result = $this->_webApiCall($serviceInfo, $requestData);
41  $this->assertTrue($result);
42  }
43 }
$objectManager
Definition: bootstrap.php:17
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)
foreach($order->getItems() as $orderItem) $shipment