@@ -107,7 +107,7 @@ public function testSimpleZeroLevel()
107
107
$ nestedResult = new NestedResult ($ result );
108
108
$ root = $ nestedResult ->getRoot (0 );
109
109
110
- $ this ->assertCount (0 , $ root ->getChildren (), 'no children expected ' );
110
+ $ this ->assertCount (0 , $ root ->getChildren (true ), 'no children expected ' );
111
111
$ this ->assertCount (12 , $ root ->getResultRows (), '12 result rows expected ' );
112
112
}
113
113
@@ -120,14 +120,14 @@ public function testSimpleOneLevel()
120
120
$ result = $ this ->makeResult ($ this ->simpleItems );
121
121
$ nestedResult = new NestedResult ($ result );
122
122
$ root = $ nestedResult ->getRoot (1 );
123
- $ tree = $ root ->getChildren ();
123
+ $ tree = $ root ->getChildren (true );
124
124
125
125
$ this ->assertCount (2 , $ tree , '2 root nodes expected ' );
126
126
$ this ->assertEquals ('car ' , $ tree [0 ]->getValueObject ()->getValue ());
127
127
$ this ->assertEquals ('laptop ' , $ tree [1 ]->getValueObject ()->getValue ());
128
128
129
- $ this ->assertCount (0 , $ tree [0 ]->getChildren (), 'no children expected ' );
130
- $ this ->assertCount (0 , $ tree [1 ]->getChildren (), 'no children expected ' );
129
+ $ this ->assertCount (0 , $ tree [0 ]->getChildren (true ), 'no children expected ' );
130
+ $ this ->assertCount (0 , $ tree [1 ]->getChildren (true ), 'no children expected ' );
131
131
132
132
$ this ->assertCount (6 , $ tree [0 ]->getResultRows (), 'result rows ' );
133
133
$ this ->assertCount (6 , $ tree [1 ]->getResultRows (), 'result rows ' );
@@ -145,23 +145,23 @@ public function testSimpleTwoLevels()
145
145
$ result = $ this ->makeResult ($ this ->simpleItems );
146
146
$ nestedResult = new NestedResult ($ result );
147
147
$ root = $ nestedResult ->getRoot (2 );
148
- $ tree = $ root ->getChildren ();
148
+ $ tree = $ root ->getChildren (true );
149
149
150
150
$ this ->assertCount (2 , $ tree , '2 root nodes expected ' );
151
151
$ this ->assertEquals ('car ' , $ tree [0 ]->getValueObject ()->getValue ());
152
152
$ this ->assertEquals ('laptop ' , $ tree [1 ]->getValueObject ()->getValue ());
153
153
154
- $ this ->assertCount (2 , $ tree [0 ]->getChildren (), '2 second level nodes expected ' );
155
- $ this ->assertCount (2 , $ tree [1 ]->getChildren (), '2 second level nodes expected ' );
154
+ $ this ->assertCount (2 , $ tree [0 ]->getChildren (true ), '2 second level nodes expected ' );
155
+ $ this ->assertCount (2 , $ tree [1 ]->getChildren (true ), '2 second level nodes expected ' );
156
156
157
- $ this ->assertCount (3 , $ tree [0 ]->getChildren ()[0 ]->getResultRows (), 'result rows ' );
158
- $ this ->assertCount (3 , $ tree [0 ]->getChildren ()[1 ]->getResultRows (), 'result rows ' );
159
- $ this ->assertCount (3 , $ tree [1 ]->getChildren ()[0 ]->getResultRows (), 'result rows ' );
160
- $ this ->assertCount (3 , $ tree [1 ]->getChildren ()[1 ]->getResultRows (), 'result rows ' );
157
+ $ this ->assertCount (3 , $ tree [0 ]->getChildren (true )[0 ]->getResultRows (), 'result rows ' );
158
+ $ this ->assertCount (3 , $ tree [0 ]->getChildren (true )[1 ]->getResultRows (), 'result rows ' );
159
+ $ this ->assertCount (3 , $ tree [1 ]->getChildren (true )[0 ]->getResultRows (), 'result rows ' );
160
+ $ this ->assertCount (3 , $ tree [1 ]->getChildren (true )[1 ]->getResultRows (), 'result rows ' );
161
161
162
162
163
- $ this ->assertEquals ('a80 ' , $ tree [0 ]->getChildren ()[0 ]->getResultRows ()[0 ][0 ]->getValue (), 'Audi 80 expected ' );
164
- $ this ->assertEquals ('pro 16 ' , $ tree [1 ]->getChildren ()[0 ]->getResultRows ()[0 ][0 ]->getValue (), 'Mac Pro 16 expected ' );
163
+ $ this ->assertEquals ('a80 ' , $ tree [0 ]->getChildren (true )[0 ]->getResultRows ()[0 ][0 ]->getValue (), 'Audi 80 expected ' );
164
+ $ this ->assertEquals ('pro 16 ' , $ tree [1 ]->getChildren (true )[0 ]->getResultRows ()[0 ][0 ]->getValue (), 'Mac Pro 16 expected ' );
165
165
}
166
166
167
167
/**
@@ -172,7 +172,7 @@ public function testMultiThreeLevels()
172
172
$ result = $ this ->makeResult ($ this ->multiItems );
173
173
$ nestedResult = new NestedResult ($ result );
174
174
$ root = $ nestedResult ->getRoot (3 );
175
- $ tree = $ root ->getChildren (); // nest: color, type, brand -> model
175
+ $ tree = $ root ->getChildren (true ); // nest: color, type, brand -> model
176
176
177
177
$ this ->assertCount (6 , $ tree , '6 root nodes of colors expected ' );
178
178
@@ -187,16 +187,16 @@ public function testMultiThreeLevels()
187
187
// Results should now show up under multiple top-level nodes
188
188
$ this ->assertEquals ('a80 ' ,
189
189
$ tree [3 ] // green
190
- ->getChildren ()[0 ] // car
191
- ->getChildren ()[0 ] // audi
190
+ ->getChildren (true )[0 ] // car
191
+ ->getChildren (true )[0 ] // audi
192
192
->getResultRows ()[0 ][0 ] // a80
193
193
->getValue (),
194
194
'green car audi a80 expected '
195
195
);
196
196
$ this ->assertEquals ('a80 ' ,
197
197
$ tree [5 ] // yellow
198
- ->getChildren ()[0 ] // car
199
- ->getChildren ()[0 ] // audi
198
+ ->getChildren (true )[0 ] // car
199
+ ->getChildren (true )[0 ] // audi
200
200
->getResultRows ()[0 ][0 ] // a80
201
201
->getValue (),
202
202
'yellow car audi a80 expected '
@@ -208,10 +208,10 @@ public function testMultiHoles()
208
208
$ result = $ this ->makeResult ($ this ->multiHoleItems );
209
209
$ nestedResult = new NestedResult ($ result );
210
210
$ root = $ nestedResult ->getRoot (3 );
211
- $ tree = $ root ->getChildren (); // nest: color, type, brand -> model
211
+ $ tree = $ root ->getChildren (true ); // nest: color, type, brand -> model
212
212
$ this ->assertCount (7 , $ tree , '6 root nodes of colors + 1 n/a expected ' ); // should have one n/a node
213
- $ this ->assertCount (2 , $ tree [6 ]->getChildren (), 'top n/a node should have car, laptop ' );
214
- $ this ->assertCount (3 , $ tree [0 ]->getChildren (), 'black should have car,laptop,n/a ' );
213
+ $ this ->assertCount (2 , $ tree [6 ]->getChildren (true ), 'top n/a node should have car, laptop ' );
214
+ $ this ->assertCount (3 , $ tree [0 ]->getChildren (true ), 'black should have car,laptop,n/a ' );
215
215
}
216
216
217
217
/**
@@ -222,10 +222,10 @@ public function testMultiMultiTwoLevels()
222
222
$ result = $ this ->makeResult ($ this ->multiMultiItems );
223
223
$ nestedResult = new NestedResult ($ result );
224
224
$ root = $ nestedResult ->getRoot (2 );
225
- $ tree = $ root ->getChildren (); // nest: material, color, *
225
+ $ tree = $ root ->getChildren (true ); // nest: material, color, *
226
226
227
227
$ this ->assertCount (3 , $ tree , '3 root nodes of material expected ' );
228
- $ this ->assertCount (1 , $ tree [0 ]->getChildren ()[0 ]->getResultRows (), '1 metal black row expected ' );
228
+ $ this ->assertCount (1 , $ tree [0 ]->getChildren (true )[0 ]->getResultRows (), '1 metal black row expected ' );
229
229
}
230
230
231
231
/**
@@ -236,11 +236,11 @@ public function testMultiMultiTwoLevelsIndex()
236
236
$ result = $ this ->makeResult ($ this ->multiMultiItems );
237
237
$ nestedResult = new NestedResult ($ result );
238
238
$ root = $ nestedResult ->getRoot (2 , 1 );
239
- $ tree = $ root ->getChildren (); // nest: index, material, color, *
239
+ $ tree = $ root ->getChildren (true ); // nest: index, material, color, *
240
240
241
241
$ this ->assertCount (3 , $ tree , '3 root index nodes expected ' );
242
242
$ this ->assertEquals ('M ' , $ tree [0 ]->getValueObject ()->getValue (), 'M expected ' );
243
- $ this ->assertCount (1 , $ tree [0 ]->getChildren (), '1 metal sub node under M expected ' );
243
+ $ this ->assertCount (1 , $ tree [0 ]->getChildren (true ), '1 metal sub node under M expected ' );
244
244
}
245
245
246
246
/**
@@ -251,7 +251,7 @@ public function testSimpleIndex()
251
251
$ result = $ this ->makeResult ($ this ->simpleItems );
252
252
$ nestedResult = new NestedResult ($ result );
253
253
$ root = $ nestedResult ->getRoot (0 , 2 );
254
- $ tree = $ root ->getChildren ();
254
+ $ tree = $ root ->getChildren (true );
255
255
256
256
$ this ->assertCount (2 , $ tree , '2 root index nodes expected ' );
257
257
$ this ->assertEquals ('CA ' , $ tree [0 ]->getValueObject ()->getValue (), 'CA(r) index expected ' );
@@ -269,7 +269,7 @@ public function testMultiIndex()
269
269
$ result = $ this ->makeResult ($ this ->multiItems );
270
270
$ nestedResult = new NestedResult ($ result );
271
271
$ root = $ nestedResult ->getRoot (0 , 2 );
272
- $ tree = $ root ->getChildren ();
272
+ $ tree = $ root ->getChildren (true );
273
273
274
274
$ this ->assertCount (4 , $ tree , '4 root index nodes expected ' );
275
275
$ this ->assertEquals ('BL ' , $ tree [0 ]->getValueObject ()->getValue (), 'BL(ack|blue) index expected ' );
0 commit comments