@@ -212,7 +212,7 @@ public function testBundleProductWithNotVisibleChildren()
212212 }
213213 $ this ->assertBundleBaseFields ($ bundleProduct , $ response ['products ' ]['items ' ][0 ]);
214214
215- $ this ->assertBundleProductOptions ($ bundleProduct , $ response ['products ' ]['items ' ][0 ], false );
215+ $ this ->assertBundleProductOptions ($ bundleProduct , $ response ['products ' ]['items ' ][0 ]);
216216 $ this ->assertNotEmpty (
217217 $ response ['products ' ]['items ' ][0 ]['items ' ],
218218 "Precondition failed: 'items' must not be empty "
@@ -242,9 +242,8 @@ private function assertBundleBaseFields($product, $actualResponse)
242242 /**
243243 * @param ProductInterface $product
244244 * @param array $actualResponse
245- * @param bool $isChildVisible
246245 */
247- private function assertBundleProductOptions ($ product , $ actualResponse, $ isChildVisible = true )
246+ private function assertBundleProductOptions ($ product , $ actualResponse )
248247 {
249248 $ this ->assertNotEmpty (
250249 $ actualResponse ['items ' ],
@@ -284,22 +283,18 @@ private function assertBundleProductOptions($product, $actualResponse, $isChildV
284283 ]
285284 );
286285 $ this ->assertEquals (
287- $ isChildVisible ? $ childProduct ->getName () : null ,
286+ $ childProduct ->getName (),
288287 $ actualResponse ['items ' ][0 ]['options ' ][0 ]['label ' ]
289288 );
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+ );
303298 }
304299
305300 /**
0 commit comments