/** * @return void */ public function testExecute() { $this->abstractBlockMock ->expects($this->once()) ->method('getCsvFile') ->willReturn(['export']); $this->layoutMock ->expects($this->once()) ->method('getChildBlock') ->with('adminhtml.report.grid', 'grid.export'); $this->fileFactoryMock ->expects($this->once()) ->method('create') ->with('new_accounts.csv', ['export'], \Magento\Framework\App\Filesystem\DirectoryList::VAR_DIR); $this->exportAccountsCsv->executeInternal(); }