Skip to content

Commit

Permalink
Added invalid data test for Copy to complete code coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul committed Jun 14, 2017
1 parent d43acb3 commit e7f28c8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions test/Integration/Mapper/Strategy/CopyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,30 @@

final class CopyTest extends \PHPUnit_Framework_TestCase
{
public function testWalkFixedPath()
public function testFixedPath()
{
$copy = (new Copy('foo->bar', ['foo' => ['bar' => 'baz']]))
->setMapper(new Mapper);

self::assertSame('baz', $copy([]));
}

public function testWalkStrategyPath()
public function testStrategyPath()
{
$copy = (new Copy(new Copy('foo'), ['bar' => 'baz']))
->setMapper(new Mapper);

self::assertSame('baz', $copy(['foo' => 'bar']));
}

/**
* Tests that null is returned when the data parameter does not resolve to an array type.
*/
public function testInvalidData()
{
$copy = (new Copy('foo', 'bar'))
->setMapper(new Mapper);

self::assertNull($copy(['foo' => 'bar']));
}
}

0 comments on commit e7f28c8

Please sign in to comment.