/** * test creditmemo get */ public function testGet() { $this->creditmemoGetMock->expects($this->once())->method('invoke')->with(1)->will($this->returnValue('creditmemo-do')); $this->assertEquals('creditmemo-do', $this->creditmemoRead->get(1)); }
/** * @param int $id * @return \Magento\Sales\Service\V1\Data\Creditmemo * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function get($id) { return $this->creditmemoGet->invoke($id); }
/** * Test creditmemo get service */ public function testInvoke() { $this->creditmemoRepositoryMock->expects($this->once())->method('get')->with($this->equalTo(1))->will($this->returnValue($this->creditmemoMock)); $this->creditmemoMapperMock->expects($this->once())->method('extractDto')->with($this->equalTo($this->creditmemoMock))->will($this->returnValue($this->dataObjectMock)); $this->assertEquals($this->dataObjectMock, $this->creditmemoGet->invoke(1)); }