@@ -212,7 +212,7 @@ public function testBundleProductWithNotVisibleChildren()
212
212
}
213
213
$ this ->assertBundleBaseFields ($ bundleProduct , $ response ['products ' ]['items ' ][0 ]);
214
214
215
- $ this ->assertBundleProductOptions ($ bundleProduct , $ response ['products ' ]['items ' ][0 ], false );
215
+ $ this ->assertBundleProductOptions ($ bundleProduct , $ response ['products ' ]['items ' ][0 ]);
216
216
$ this ->assertNotEmpty (
217
217
$ response ['products ' ]['items ' ][0 ]['items ' ],
218
218
"Precondition failed: 'items' must not be empty "
@@ -242,9 +242,8 @@ private function assertBundleBaseFields($product, $actualResponse)
242
242
/**
243
243
* @param ProductInterface $product
244
244
* @param array $actualResponse
245
- * @param bool $isChildVisible
246
245
*/
247
- private function assertBundleProductOptions ($ product , $ actualResponse, $ isChildVisible = true )
246
+ private function assertBundleProductOptions ($ product , $ actualResponse )
248
247
{
249
248
$ this ->assertNotEmpty (
250
249
$ actualResponse ['items ' ],
@@ -284,22 +283,18 @@ private function assertBundleProductOptions($product, $actualResponse, $isChildV
284
283
]
285
284
);
286
285
$ this ->assertEquals (
287
- $ isChildVisible ? $ childProduct ->getName () : null ,
286
+ $ childProduct ->getName (),
288
287
$ actualResponse ['items ' ][0 ]['options ' ][0 ]['label ' ]
289
288
);
290
- if ($ isChildVisible ) {
291
- $ this ->assertResponseFields (
292
- $ actualResponse ['items ' ][0 ]['options ' ][0 ]['product ' ],
293
- [
294
- 'id ' => $ childProduct ->getId (),
295
- 'name ' => $ childProduct ->getName (),
296
- 'type_id ' => $ childProduct ->getTypeId (),
297
- 'sku ' => $ childProduct ->getSku ()
298
- ]
299
- );
300
- } else {
301
- $ this ->assertNull ($ actualResponse ['items ' ][0 ]['options ' ][0 ]['product ' ]);
302
- }
289
+ $ this ->assertResponseFields (
290
+ $ actualResponse ['items ' ][0 ]['options ' ][0 ]['product ' ],
291
+ [
292
+ 'id ' => $ childProduct ->getId (),
293
+ 'name ' => $ childProduct ->getName (),
294
+ 'type_id ' => $ childProduct ->getTypeId (),
295
+ 'sku ' => $ childProduct ->getSku ()
296
+ ]
297
+ );
303
298
}
304
299
305
300
/**
0 commit comments