Skip to content

Commit 1ee5325

Browse files
committed
Improved test
1 parent 6ff74ad commit 1ee5325

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/DeepCopy/DeepCopy.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
namespace DeepCopy;
44

55
use DeepCopy\Filter\Filter;
6-
use DeepCopy\Filter\SetNullFilter;
76
use DeepCopy\Matcher\Matcher;
8-
use DeepCopy\Matcher\PropertyMatcher;
9-
use ReflectionClass;
107
use ReflectionProperty;
118

129
/**

tests/DeepCopyTest/DeepCopyTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,17 @@ public function testCycleCopy2()
8181
$this->assertSame($a2, $a2->property->property);
8282
}
8383

84+
/**
85+
* Dynamic properties should be cloned
86+
*/
8487
public function testDynamicProperties()
8588
{
8689
$a = new \stdClass();
8790
$a->b = new \stdClass();
8891

8992
$deepCopy = new DeepCopy();
9093
$a2 = $deepCopy->copy($a);
94+
$this->assertNotSame($a->b, $a2->b);
9195
$this->assertDeepCopyOf($a, $a2);
9296
}
9397

0 commit comments

Comments
 (0)