コード例 #1
0
 public function testExecute()
 {
     $path = '*/*';
     $this->resultRedirectFactory->expects($this->any())->method('create')->willReturn($this->resultRedirect);
     $this->messageManager->expects($this->once())->method('addSuccess')->with(__('We updated lifetime statistic.'));
     $this->objectManager->expects($this->any())->method('create')->with('Magento\\Sales\\Model\\Resource\\Report\\Order')->willReturn($this->order);
     $this->resultRedirect->expects($this->once())->method('setPath')->with($path)->willReturnSelf();
     $this->assertInstanceOf('Magento\\Backend\\Model\\View\\Result\\Redirect', $this->refreshStatisticsController->execute());
 }
コード例 #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);
     }
 }