File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,12 @@ public function testRemoveChild()
5050 $ i ++;
5151 }
5252
53- $ this ->expectException (Exception::class);
53+ // Check all children have correct parent
54+ foreach ($ object ->getChildren () as $ child ) {
55+ self ::assertEquals ($ child ->getParent (), $ object );
56+ }
5457
58+ $ this ->expectException (Exception::class);
5559 $ object ->removeChild ($ unknownChild );
5660 }
5761
@@ -117,6 +121,11 @@ public function testReplaceChild()
117121 $ i ++;
118122 }
119123
124+ // Check all children have correct parent
125+ foreach ($ object ->getChildren () as $ child ) {
126+ self ::assertEquals ($ child ->getParent (), $ object );
127+ }
128+
120129 // Exception if we trying replace unknown child
121130 $ this ->expectException (Exception::class);
122131 $ object ->replaceChild ($ unknownChild , $ replacement );
@@ -160,5 +169,10 @@ public function testAppendChild()
160169 self ::assertEquals ($ i , $ index );
161170 $ i ++;
162171 }
172+
173+ // Check all children have correct parent
174+ foreach ($ object ->getChildren () as $ child ) {
175+ self ::assertEquals ($ child ->getParent (), $ object );
176+ }
163177 }
164178}
You can’t perform that action at this time.
0 commit comments