Example #1
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);
     }
 }
 public function testExecuteException()
 {
     $exception = new \Exception('Exception message');
     $this->prepareMocksForTesting();
     $this->customerData->expects($this->once())->method('getDefaultBilling')->willReturn(false);
     $this->customerRepository->expects($this->once())->method('save')->with($this->customerData)->willThrowException($exception);
     $this->messageManager->expects($this->once())->method('addError')->with('[Customer ID: 12] We can\'t save the customer.');
     $this->logger->expects($this->once())->method('critical')->with($exception);
     $this->prepareMocksForErrorMessagesProcessing();
     $this->assertSame($this->resultJson, $this->controller->execute());
 }