Пример #1
0
 /**
  * Invoke shipment add track service
  *
  * @param \Magento\Sales\Service\V1\Data\ShipmentTrack $track
  * @return bool
  * @throws \Exception
  */
 public function invoke(ShipmentTrack $track)
 {
     /** @var \Magento\Sales\Model\Order\Shipment\Track $trackModel */
     $trackModel = $this->trackConverter->getModel($track);
     $trackModel->save();
     return true;
 }
Пример #2
0
 /**
  * Test shipment add track service
  */
 public function testInvoke()
 {
     $this->trackConverterMock->expects($this->once())->method('getModel')->with($this->equalTo($this->dataObjectMock))->will($this->returnValue($this->dataModelMock));
     $this->dataModelMock->expects($this->once())->method('save');
     $this->assertTrue($this->shipmentAddTrack->invoke($this->dataObjectMock));
 }