Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ExportAccountsExcelTest.php
Go to the documentation of this file.
1 <?php
8 
10 
12 {
17 
21  protected function setUp()
22  {
23  parent::setUp();
24 
25  $this->exportAccountsExcel = new ExportAccountsExcel(
26  $this->contextMock,
27  $this->fileFactoryMock
28  );
29  }
30 
34  public function testExecute()
35  {
36  $this->abstractBlockMock
37  ->expects($this->once())
38  ->method('getExcelFile')
39  ->willReturn(['export']);
40  $this->layoutMock
41  ->expects($this->once())
42  ->method('getChildBlock')
43  ->with('adminhtml.report.grid', 'grid.export');
44  $this->fileFactoryMock
45  ->expects($this->once())
46  ->method('create')
47  ->with('new_accounts.xml', ['export'], \Magento\Framework\App\Filesystem\DirectoryList::VAR_DIR);
48  $this->exportAccountsExcel->execute();
49  }
50 }