From b776ec3a61e4f0d84c2b8abf74a8f789ee9724cd Mon Sep 17 00:00:00 2001 From: Ievgenii Gryshkun Date: Tue, 11 Jun 2019 11:15:29 +0300 Subject: [PATCH] Product media_gallery_entries / types only present if image, thumbnail, small_image is requested --- .../GraphQl/Catalog/MediaGalleryTest.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php index 8da2702917af0..38ba4760e93a3 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php @@ -45,6 +45,33 @@ public function testProductSmallImageUrlWithExistingImage() self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image']['url'])); } + /** + * @magentoApiDataFixture Magento/Catalog/_files/product_with_image.php + */ + public function testProductMediaGalleryEntries() + { + $productSku = 'simple'; + $query = <<graphQlQuery($query); + + self::assertArrayHasKey('file', $response['products']['items'][0]['media_gallery_entries'][0]); + self::assertContains('magento_image.jpg', $response['products']['items'][0]['media_gallery_entries'][0]['url']); + } + /** * @param string $url * @return bool