/** * Run test setVoid method */ public function testSetVoid() { $id = 145; $returnValue = true; $invoiceMock = $this->getMock('Magento\\Sales\\Model\\Order\\Invoice', ['void'], [], '', false); $this->repositoryMock->expects($this->once())->method('get')->with($id)->will($this->returnValue($invoiceMock)); $invoiceMock->expects($this->once())->method('void')->will($this->returnValue($returnValue)); $this->assertTrue($this->invoiceService->setVoid($id)); }