/** * @return void */ public function testExecute() { $titleMock = $this->getMockBuilder('Magento\\Framework\\View\\Page\\Title')->disableOriginalConstructor()->getMock(); $titleMock->expects($this->once())->method('prepend')->with(new Phrase('Downloads Report')); $this->viewMock->expects($this->once())->method('getPage')->willReturn(new Object(['config' => new Object(['title' => $titleMock])])); $this->menuBlockMock->expects($this->once())->method('setActive')->with('Magento_Downloadable::report_products_downloads'); $this->breadcrumbsBlockMock->expects($this->exactly(3))->method('addLink')->withConsecutive([new Phrase('Reports'), new Phrase('Reports')], [new Phrase('Products'), new Phrase('Products')], [new Phrase('Downloads'), new Phrase('Downloads')]); $this->layoutMock->expects($this->once())->method('createBlock')->with('Magento\\Reports\\Block\\Adminhtml\\Product\\Downloads')->willReturn($this->abstractBlockMock); $this->downloads->execute(); }
/** * {@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); } }