@@ -156,7 +156,11 @@ private function assertProductThumbnailUrl(array $thumbnails): void
156156 );
157157 }
158158
159+ /**
160+ * @throws LocalizedException
161+ */
159162 #[
163+ ConfigFixture('checkout/cart/grouped_product_image ' , 'itself ' ),
160164 DataFixture(CategoryFixture::class, ['name ' => 'Category ' ], 'category ' ),
161165 DataFixture(
162166 ProductFixture::class,
@@ -195,20 +199,11 @@ private function assertProductThumbnailUrl(array $thumbnails): void
195199 ]
196200 public function testAddGroupedProductToCartWithoutImageShouldUseThumbnail ()
197201 {
198- $ cartId = DataFixtureStorageManager::getStorage ()->get ('quoteIdMask ' )->getMaskedId ();
199- $ groupedProductId = DataFixtureStorageManager::getStorage ()->get ('grouped-product ' )->getSku ();
200- $ response = $ this ->graphQlMutation ($ this ->getMutation ($ cartId , $ groupedProductId ));
201-
202- $ this ->assertArrayHasKey ('addProductsToCart ' , $ response );
203- $ this ->assertEquals (2 , count ($ response ['addProductsToCart ' ]['cart ' ]['itemsV2 ' ]['items ' ]));
204- $ this ->assertStringContainsString (
205- self ::DEFAULT_THUMBNAIL_PATH ,
206- $ response ['addProductsToCart ' ]['cart ' ]['itemsV2 ' ]['items ' ][0 ]['product ' ]['thumbnail ' ]['url ' ]
207- );
208- $ this ->assertStringContainsString (
209- self ::DEFAULT_THUMBNAIL_PATH ,
210- $ response ['addProductsToCart ' ]['cart ' ]['itemsV2 ' ]['items ' ][1 ]['product ' ]['thumbnail ' ]['url ' ]
211- );
202+ $ thumbnails = [
203+ 'product1 ' => self ::DEFAULT_THUMBNAIL_PATH ,
204+ 'product2 ' => self ::DEFAULT_THUMBNAIL_PATH
205+ ];
206+ $ this ->assertProductThumbnailUrl ($ thumbnails );
212207 }
213208
214209 /**
0 commit comments