/** * @covers \Magento\Sales\Controller\Adminhtml\Order\Creditmemo\PrintAction::execute */ public function testExecuteNoCreditmemoId() { $this->prepareTestExecute(); $this->resultForwardFactoryMock->expects($this->once())->method('create')->willReturn($this->resultForwardMock); $this->resultForwardMock->expects($this->once())->method('forward')->with('noroute')->willReturnSelf(); $this->assertInstanceOf('Magento\\Backend\\Model\\View\\Result\\Forward', $this->printAction->execute()); }
public function testExecuteModelException() { $this->requestMock->expects($this->at(0))->method('getParam')->with('order_id')->willReturn(1); $this->requestMock->expects($this->at(1))->method('getParam')->with('creditmemo_id')->willReturn(1); $this->requestMock->expects($this->at(2))->method('getParam')->with('creditmemo')->willReturn('some data'); $this->requestMock->expects($this->at(3))->method('getParam')->with('invoice_id')->willReturn(1); $this->loaderMock->expects($this->once())->method('load')->willReturn($this->creditmemoMock); $this->assertNull($this->controller->execute()); }