ExcelReaderFactoryTest::testGetReader()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
dl 0
loc 11
rs 9.4285
c 1
b 1
f 0
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
3
namespace Port\Excel\Tests;
4
5
use Port\Excel\ExcelReaderFactory;
6
7
class ExcelReaderFactoryTest extends \PHPUnit_Framework_TestCase
8
{
9
    public function setUp()
10
    {
11
        if (!extension_loaded('zip')) {
12
            $this->markTestSkipped();
13
        }
14
    }
15
16
    public function testGetReader()
17
    {
18
        $factory = new ExcelReaderFactory();
19
        $reader = $factory->getReader(new \SplFileObject(__DIR__.'/fixtures/data_column_headers.xlsx'));
20
        $this->assertInstanceOf('\Port\Excel\ExcelReader', $reader);
21
        $this->assertCount(4, $reader);
22
23
        $factory = new ExcelReaderFactory(0);
24
        $reader = $factory->getReader(new \SplFileObject(__DIR__.'/fixtures/data_column_headers.xlsx'));
25
        $this->assertCount(3, $reader);
26
    }
27
}
28