Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CreditmemoEmailTest.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
15  const SERVICE_VERSION = 'V1';
16 
17  const SERVICE_NAME = 'salesCreditmemoManagementV1';
18 
19  const CREDITMEMO_INCREMENT_ID = '100000001';
20 
24  public function testCreditmemoEmail()
25  {
27 
29  $creditmemoCollection = $objectManager->get(
30  \Magento\Sales\Model\ResourceModel\Order\Creditmemo\Collection::class
31  );
32  $creditmemo = $creditmemoCollection->getFirstItem();
33  $serviceInfo = [
34  'rest' => [
35  'resourcePath' => '/V1/creditmemo/' . $creditmemo->getId() . '/emails',
37  ],
38  'soap' => [
39  'service' => self::SERVICE_NAME,
40  'serviceVersion' => self::SERVICE_VERSION,
41  'operation' => self::SERVICE_NAME . 'notify',
42  ],
43  ];
44  $requestData = ['id' => $creditmemo->getId()];
45  $this->_webApiCall($serviceInfo, $requestData);
46  }
47 }
$objectManager
Definition: bootstrap.php:17
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)