ExcelReaderFactoryTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 21
rs 10
c 1
b 1
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 2
A testGetReader() 0 11 1
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