for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Coco\SourceWatcher\Tests\Core\Transformers;
use PHPUnit\Framework\TestCase;
use Coco\SourceWatcher\Core\Transformers\RenameColumnsTransformer;
use Coco\SourceWatcher\Core\Row;
class RenameColumnsTransformerTest extends TestCase
{
public function testRenameColumns () : void
$transformer = new RenameColumnsTransformer();
$transformer->options( [ "columns" => [ "email_address" => "email" ] ] );
$givenRow = new Row( [ "id" => "1", "name" => "John Doe", "email_address" => "[email protected]" ] );
$transformer->transform( $givenRow );
$expectedRow = new Row( [ "id" => "1", "name" => "John Doe", "email" => "[email protected]" ] );
$this->assertEquals( $expectedRow, $givenRow );
}