Example #1
0
    public function testEmailNoCreditmemoId()
    {
        $this->request->expects($this->once())
            ->method('getParam')
            ->with('creditmemo_id')
            ->will($this->returnValue(null));

        $this->assertNull($this->creditmemoEmail->executeInternal());
    }
Example #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);
     }
 }
Example #3
0
 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());
 }