コード例 #1
0
ファイル: FactoryTest.php プロジェクト: gko1943/ExcelBundle
 public function testCreateStreamedResponse()
 {
     $writer = $this->getMock('\\PHPExcel_Writer_IWriter');
     $writer->expects($this->once())->method('save')->with('php://output');
     $factory = new Factory();
     $factory->createStreamedResponse($writer)->sendContent();
 }
コード例 #2
0
ファイル: ExcelExport.php プロジェクト: Opifer/CrudBundle
 /**
  * @inheritdoc
  */
 public function createResponse()
 {
     $writer = $this->factory->createWriter($this->phpExcel, 'Excel5');
     $response = $this->factory->createStreamedResponse($writer);
     $response->headers->set('Content-Type', 'text/vnd.ms-excel; charset=utf-8');
     $response->headers->set('Content-Disposition', 'attachment;filename=datagrid-export.xls');
     $response->headers->set('Pragma', 'public');
     $response->headers->set('Cache-Control', 'maxage=1');
     return $response;
 }
コード例 #3
0
ファイル: FactoryTest.php プロジェクト: jichi921/ExcelBundle
 public function testCreateHelperHtml()
 {
     $factory = new Factory();
     $helperHtml = $factory->createHelperHTML();
     $this->assertInstanceOf('\\PHPExcel_Helper_HTML', $helperHtml);
 }