예제 #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);
     }
 }
예제 #2
0
 public function testExecuteException()
 {
     $queryId = 1;
     $queryText = 'search';
     $this->mockGetRequestData($queryText, $queryId);
     $this->request->expects($this->at(4))->method('getPost')->with('store_id', false)->willReturn(1);
     $this->query->expects($this->once())->method('setStoreId');
     $this->query->expects($this->once())->method('loadByQueryText')->willThrowException(new \Exception());
     $this->messageManager->expects($this->once())->method('addException');
     $this->session->expects($this->once())->method('setPageData');
     $this->redirect->expects($this->once())->method('setPath')->willReturnSelf();
     $this->assertSame($this->redirect, $this->controller->execute());
 }