Exemplo n.º 1
0
 /**
  * @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());
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function dispatch(\Magento\Framework\App\RequestInterface $request)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'dispatch');
     if (!$pluginInfo) {
         return parent::dispatch($request);
     } else {
         return $this->___callPlugins('dispatch', func_get_args(), $pluginInfo);
     }
 }
Exemplo n.º 3
0
 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());
 }