Exemplo n.º 1
0
 /**
  * @return void
  */
 public function testExecute()
 {
     $content = ['export'];
     $this->abstractBlockMock->expects($this->once())->method('getCsvFile')->willReturn($content);
     $this->layoutMock->expects($this->once())->method('getChildBlock')->with('adminhtml.block.report.product.lowstock.grid', 'grid.export')->willReturn($this->abstractBlockMock);
     $this->fileFactoryMock->expects($this->once())->method('create')->with('products_lowstock.csv', $content, \Magento\Framework\App\Filesystem\DirectoryList::VAR_DIR);
     $this->exportLowstockCsv->execute();
 }
Exemplo n.º 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);
     }
 }