public function testEmailNoCreditmemo() { $cmId = 10000031; $creditmemoClassName = 'Magento\\Sales\\Model\\Order\\Creditmemo'; $creditmemo = $this->getMock($creditmemoClassName, ['load', '__wakeup'], [], '', false); $this->request->expects($this->once())->method('getParam')->with('creditmemo_id')->will($this->returnValue($cmId)); $this->objectManager->expects($this->at(0))->method('create')->with($creditmemoClassName)->will($this->returnValue($creditmemo)); $creditmemo->expects($this->once())->method('load')->with($cmId)->will($this->returnValue(null)); $this->assertNull($this->creditmemoEmail->execute()); }
public function testEmailNoCreditmemoId() { $this->request->expects($this->once())->method('getParam')->with('creditmemo_id')->will($this->returnValue(null)); $this->assertNull($this->creditmemoEmail->execute()); }