/** * test creditmemo create */ public function testCreate() { $creditmemo = $this->getMock('\\Magento\\Sales\\Service\\V1\\Data\\Creditmemo', [], [], '', false); $this->creditmemoCreateMock->expects($this->once())->method('invoke')->with($creditmemo)->will($this->returnValue(true)); $this->assertTrue($this->creditmemoWrite->create($creditmemo)); }