/** * @return void */ public function testExecute() { $content = ['export']; $this->abstractBlockMock->expects($this->once())->method('getExcelFile')->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.xml', $content, \Magento\Framework\App\Filesystem\DirectoryList::VAR_DIR); $this->exportLowstockExcel->execute(); }