Пример #1
0
 public function test_factory_returns_writer()
 {
     $workbook = new Workbook('mock');
     $workbook->sheet('mock');
     $this->assertInstanceOf('Maatwebsite\\Clerk\\Excel\\Adapters\\PHPExcel\\Writers\\Writer', WriterFactory::create(new PHPExcel('drivers.writer.excel2003'), 'Excel5', 'xls', $workbook));
     $this->assertInstanceOf('Maatwebsite\\Clerk\\Excel\\Adapters\\PHPExcel\\Writers\\Writer', WriterFactory::create(new PHPExcel('drivers.writer.excel2007'), 'Excel2007', 'xlsx', $workbook));
     $this->assertInstanceOf('Maatwebsite\\Clerk\\Excel\\Adapters\\LeagueCsv\\Writers\\CsvWriter', WriterFactory::create(new LeagueCsv('drivers.writer.csv'), 'Csv', 'csv', $workbook));
     $this->assertInstanceOf('Maatwebsite\\Clerk\\Excel\\Adapters\\PHPExcel\\Writers\\CsvWriter', WriterFactory::create(new PHPExcel('drivers.writer.csv'), 'Csv', 'csv', $workbook));
 }
Пример #2
0
 public function test_remove_a_sheet_by_index()
 {
     $workbook = new Workbook('Workbook title');
     $workbook->sheet('sheet title');
     $this->assertEquals(1, $workbook->getSheetCount());
     $workbook->removeSheetByIndex(0);
     $this->assertEquals(0, $workbook->getSheetCount());
 }