Skip to content

Commit

Permalink
Merge branch '2.3-develop##612' of github.com:XxXgeoXxX/graphql-ce in…
Browse files Browse the repository at this point in the history
…to 612-skip
  • Loading branch information
lenaorobei committed Jun 12, 2019
2 parents dffe94d + b776ec3 commit f01d084
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getList(
): SearchResultsInterface {
/** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */
$collection = $this->collectionFactory->create();

$attributes = array_unique(array_merge($attributes, ['small_image', 'thumbnail', 'image']));
$this->collectionProcessor->process($collection, $searchCriteria, $attributes);

if (!$isChildSearch) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <<<QUERY
{
products(filter: {sku: {eq: "{$productSku}"}}) {
items {
name
sku
media_gallery_entries {
id
file
types
}
}
}
}
QUERY;
$response = $this->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
Expand Down

0 comments on commit f01d084

Please sign in to comment.