Passed
Push — master ( abded9...99e8d5 )
by Daniel
01:51
created

ArrayToCsvTest::testAddDataSet()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
/**
4
 * This file is part of the Csv-Machine package.
5
 *
6
 * (c) Dan McAdams <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace RoadBunch\Csv\Tests\Csv;
13
14
15
use PHPUnit\Framework\TestCase;
16
17
class ArrayToCsvTest extends TestCase
18
{
19
    public function testAddDataSet()
20
    {
21
        $data = [];
22
23
        $csv = new CsvSpy($data);
24
        $this->assertEquals($data, $csv->getRawData());
25
26
        $data = [['dan', 'mcadams',],['john','doe'],['lara','johnson']];
27
        $csv = new CsvSpy($data);
28
        $this->assertEquals($data, $csv->getRawData());
29
30
        $data = [
31
            ['first_name' => 'John', 'last_name' => 'Doe', 'employee_id' => '742617000027'],
32
            ['first_name' => 'Jane', 'last_name' => 'Jackson', 'employee_id' => '0003645'],
33
            ['first_name' => 'Dede', 'last_name' => 'Gore', 'employee_id' => 'OMG12324']
34
        ];
35
        $csv = new CsvSpy($data);
36
        $this->assertEquals($data, $csv->getRawData());
37
    }
38
}