-
Notifications
You must be signed in to change notification settings - Fork 134
Expand file tree
/
Copy pathFactoryTest.php
More file actions
45 lines (36 loc) · 1.22 KB
/
Copy pathFactoryTest.php
File metadata and controls
45 lines (36 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace Liuggio\ExcelBundle\Tests;
use Liuggio\ExcelBundle\Factory;
class FactoryTest extends \PHPUnit_Framework_TestCase
{
public function testCreate()
{
$factory = new Factory();
$this->assertInstanceOf('\PHPExcel', $factory->createPHPExcelObject());
}
public function testCreateReader()
{
$factory = new Factory();
$this->assertInstanceOf('\PHPExcel_Reader_IReader', $factory->createReader());
}
public function testCreateWriter()
{
$factory = new Factory();
$this->assertInstanceOf('\PHPExcel_Writer_IWriter', $factory->createWriter($factory->createPHPExcelObject()));
}
public function testCreateStreamedResponse()
{
$writer = $this->getMockBuilder('\PHPExcel_Writer_IWriter')->getMock();
$writer->expects($this->once())
->method('save')
->with('php://output');
$factory = new Factory();
$factory->createStreamedResponse($writer)->sendContent();
}
public function testCreateHelperHtml()
{
$factory = new Factory();
$helperHtml = $factory->createHelperHTML();
$this->assertInstanceOf('\PHPExcel_Helper_HTML', $helperHtml);
}
}