DbalReaderFactoryTest::testGetReader()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 0
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