/** * @param int $id * @return bool * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function capture($id) { return $this->invoiceCapture->invoke($id); }
/** * test invoice capture service */ public function testInvoke() { $this->invoiceRepositoryMock->expects($this->once())->method('get')->with($this->equalTo(1))->will($this->returnValue($this->invoiceMock)); $this->invoiceMock->expects($this->once())->method('capture')->will($this->returnSelf()); $this->assertTrue($this->invoiceCapture->invoke(1)); }
/** * test invoice capture */ public function testCapture() { $this->invoiceCaptureMock->expects($this->once())->method('invoke')->with(1)->will($this->returnValue(true)); $this->assertTrue($this->invoiceWrite->capture(1)); }