DbalReaderFactoryTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 2
A testGetReader() 0 11 1
1
<?php
2
3
namespace Ddeboer\DataImport\Tests\Reader\Factory;
4
5
use Ddeboer\DataImport\Reader\Factory\ExcelReaderFactory;
6
7
class DbalReaderFactoryTest 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('\Ddeboer\DataImport\Reader\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