Skip to content

Commit e7f28c8

Browse files
author
Paul
committed
Added invalid data test for Copy to complete code coverage.
1 parent d43acb3 commit e7f28c8

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/Integration/Mapper/Strategy/CopyTest.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,30 @@
66

77
final class CopyTest extends \PHPUnit_Framework_TestCase
88
{
9-
public function testWalkFixedPath()
9+
public function testFixedPath()
1010
{
1111
$copy = (new Copy('foo->bar', ['foo' => ['bar' => 'baz']]))
1212
->setMapper(new Mapper);
1313

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

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

2222
self::assertSame('baz', $copy(['foo' => 'bar']));
2323
}
24+
25+
/**
26+
* Tests that null is returned when the data parameter does not resolve to an array type.
27+
*/
28+
public function testInvalidData()
29+
{
30+
$copy = (new Copy('foo', 'bar'))
31+
->setMapper(new Mapper);
32+
33+
self::assertNull($copy(['foo' => 'bar']));
34+
}
2435
}

0 commit comments

Comments
 (0)