/** * Run test notify method */ public function testNotify() { $id = 123; $returnValue = 'return-value'; $modelMock = $this->getMockForAbstractClass('Magento\\Sales\\Model\\AbstractModel', [], '', false); $this->repositoryMock->expects($this->once())->method('get')->with($id)->will($this->returnValue($modelMock)); $this->notifierMock->expects($this->once())->method('notify')->with($modelMock)->will($this->returnValue($returnValue)); $this->assertEquals($returnValue, $this->shipmentService->notify($id)); }
/** * Invoke notifyUser service * * @param int $id * @return bool */ public function invoke($id) { /** @var \Magento\Sales\Model\Order\Shipment $shipment */ $shipment = $this->shipmentRepository->get($id); return $this->notifier->notify($shipment); }
/** * Notify user * * @param int $id * @return bool */ public function notify($id) { $shipment = $this->repository->get($id); return $this->notifier->notify($shipment); }