コード例 #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
 /**
  * @covers \Magento\Email\Controller\Adminhtml\Email\Template\Index::execute
  */
 public function testExecute()
 {
     $this->prepareExecute();
     $this->viewMock->expects($this->atLeastOnce())->method('getLayout')->willReturn($this->layoutMock);
     $this->layoutMock->expects($this->at(0))->method('getBlock')->with('menu')->will($this->returnValue($this->menuBlockMock));
     $this->menuBlockMock->expects($this->any())->method('getMenuModel')->will($this->returnSelf());
     $this->menuBlockMock->expects($this->any())->method('getParentItems')->will($this->returnValue([]));
     $this->viewMock->expects($this->once())->method('getPage')->willReturn($this->resultPageMock);
     $this->resultPageMock->expects($this->once())->method('getConfig')->willReturn($this->pageConfigMock);
     $this->pageConfigMock->expects($this->once())->method('getTitle')->willReturn($this->pageTitleMock);
     $this->pageTitleMock->expects($this->once())->method('prepend')->with('Email Templates');
     $this->layoutMock->expects($this->at(1))->method('getBlock')->with('breadcrumbs')->will($this->returnValue($this->breadcrumbsBlockMock));
     $this->breadcrumbsBlockMock->expects($this->any())->method('addLink')->willReturnSelf();
     $this->assertNull($this->indexController->execute());
 }