Passed
Pull Request — master (#7)
by Jean Paul
01:59
created

RenameColumnsTransformerTest::testRenameColumns()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 12
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Coco\SourceWatcher\Tests\Core\Transformers;
4
5
use PHPUnit\Framework\TestCase;
6
use Coco\SourceWatcher\Core\Transformers\RenameColumnsTransformer;
7
use Coco\SourceWatcher\Core\Row;
8
9
class RenameColumnsTransformerTest extends TestCase
10
{
11
    public function testRenameColumns () : void
12
    {
13
        $transformer = new RenameColumnsTransformer();
14
        $transformer->options( [ "columns" => [ "email_address" => "email" ] ] );
15
16
        $givenRow = new Row( [ "id" => "1", "name" => "John Doe", "email_address" => "[email protected]" ] );
17
18
        $transformer->transform( $givenRow );
19
20
        $expectedRow = new Row( [ "id" => "1", "name" => "John Doe", "email" => "[email protected]" ] );
21
22
        $this->assertEquals( $expectedRow, $givenRow );
23
    }
24
}
25