RenameColumnsTransformerTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 7
c 1
b 0
f 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testRenameColumns() 0 12 1
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
/**
10
 * Class RenameColumnsTransformerTest
11
 *
12
 * @package Coco\SourceWatcher\Tests\Core\Transformers
13
 */
14
class RenameColumnsTransformerTest extends TestCase
15
{
16
    public function testRenameColumns () : void
17
    {
18
        $transformer = new RenameColumnsTransformer();
19
        $transformer->options( [ "columns" => [ "email_address" => "email" ] ] );
20
21
        $givenRow = new Row( [ "id" => "1", "name" => "John Doe", "email_address" => "[email protected]" ] );
22
23
        $transformer->transform( $givenRow );
24
25
        $expectedRow = new Row( [ "id" => "1", "name" => "John Doe", "email" => "[email protected]" ] );
26
27
        $this->assertEquals( $expectedRow, $givenRow );
28
    }
29
}
30