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