@@ -158,29 +158,41 @@ public function test_it_can_copy_an_object_with_a_date_object_property()
158158 /**
159159 * @ticket https://github.com/myclabs/DeepCopy/pull/70
160160 */
161- public function test_it_does_not_skip_the_copy_for_userland_datetimezone ()
161+ public function test_it_skips_the_copy_for_userland_datetimezone ()
162162 {
163+ $ deepCopy = new DeepCopy ();
164+ $ deepCopy ->addFilter (
165+ new SetNullFilter (),
166+ new PropertyNameMatcher ('cloned ' )
167+ );
168+
163169 $ object = new stdClass ();
164170
165171 $ object ->dtz = new f007 \FooDateTimeZone ('UTC ' );
166172
167- $ copy = deep_copy ($ object );
173+ $ copy = $ deepCopy -> copy ($ object );
168174
169- $ this ->assertEqualButNotSame ( $ object ->dtz , $ copy -> dtz );
175+ $ this ->assertTrue ( $ copy ->dtz -> cloned );
170176 }
171177
172178 /**
173179 * @ticket https://github.com/myclabs/DeepCopy/pull/76
174180 */
175- public function test_it_does_not_skip_the_copy_for_userland_dateinterval ()
181+ public function test_it_skips_the_copy_for_userland_dateinterval ()
176182 {
183+ $ deepCopy = new DeepCopy ();
184+ $ deepCopy ->addFilter (
185+ new SetNullFilter (),
186+ new PropertyNameMatcher ('cloned ' )
187+ );
188+
177189 $ object = new stdClass ();
178190
179191 $ object ->di = new f007 \FooDateInterval ('P2D ' );
180192
181- $ copy = deep_copy ($ object );
193+ $ copy = $ deepCopy -> copy ($ object );
182194
183- $ this ->assertEqualButNotSame ( $ object ->di , $ copy -> di );
195+ $ this ->assertTrue ( $ copy ->di -> cloned );
184196 }
185197
186198 public function test_it_copies_the_private_properties_of_the_parent_class ()
0 commit comments