File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,33 @@ public function testProductSmallImageUrlWithExistingImage()
45
45
self ::assertTrue ($ this ->checkImageExists ($ response ['products ' ]['items ' ][0 ]['small_image ' ]['url ' ]));
46
46
}
47
47
48
+ /**
49
+ * @magentoApiDataFixture Magento/Catalog/_files/product_with_image.php
50
+ */
51
+ public function testProductMediaGalleryEntries ()
52
+ {
53
+ $ productSku = 'simple ' ;
54
+ $ query = <<<QUERY
55
+ {
56
+ products(filter: {sku: {eq: " {$ productSku }"}}) {
57
+ items {
58
+ name
59
+ sku
60
+ media_gallery_entries {
61
+ id
62
+ file
63
+ types
64
+ }
65
+ }
66
+ }
67
+ }
68
+ QUERY ;
69
+ $ response = $ this ->graphQlQuery ($ query );
70
+
71
+ self ::assertArrayHasKey ('file ' , $ response ['products ' ]['items ' ][0 ]['media_gallery_entries ' ][0 ]);
72
+ self ::assertContains ('magento_image.jpg ' , $ response ['products ' ]['items ' ][0 ]['media_gallery_entries ' ][0 ]['url ' ]);
73
+ }
74
+
48
75
/**
49
76
* @param string $url
50
77
* @return bool
You can’t perform that action at this time.
0 commit comments