Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 /**
  * @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;
 }
Exemplo n.º 3
0
 public function testCreateHelperHtml()
 {
     $factory = new Factory();
     $helperHtml = $factory->createHelperHTML();
     $this->assertInstanceOf('\\PHPExcel_Helper_HTML', $helperHtml);
 }