public function testExecute() { $this->menuMock->expects($this->once())->method('getParentItems')->willReturn([$this->menuItemMock]); $this->titleMock->expects($this->atLeastOnce())->method('prepend'); $this->pageConfigMock->expects($this->atLeastOnce())->method('getTitle')->willReturn($this->titleMock); $this->pageMock->expects($this->atLeastOnce())->method('getConfig')->willReturn($this->pageConfigMock); $this->blockMock->expects($this->atLeastOnce())->method('addLink'); $this->blockMock->expects($this->once())->method('setActive'); $this->blockMock->expects($this->once())->method('getMenuModel')->willReturn($this->menuMock); $this->layoutMock->expects($this->atLeastOnce())->method('getBlock')->willReturn($this->blockMock); $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); $this->viewMock->expects($this->atLeastOnce())->method('getLayout')->willReturn($this->layoutMock); $this->viewMock->expects($this->atLeastOnce())->method('getPage')->willReturn($this->pageMock); $this->action->executeInternal(); }
/** * {@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); } }