Skip to content

Commit

Permalink
magento/graphql-ce#612: Product media_gallery_entries / types only pr…
Browse files Browse the repository at this point in the history
…esent if image, thumbnail, small_image is requested

- skipped test magento/graphql-ce#738
  • Loading branch information
lenaorobei committed Jun 12, 2019
1 parent f01d084 commit 44d7ff4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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 @@ -9,6 +9,9 @@

use Magento\TestFramework\TestCase\GraphQlAbstract;

/**
* Test cases for product media gallery data retrieval.
*/
class MediaGalleryTest extends GraphQlAbstract
{
/**
Expand Down Expand Up @@ -50,6 +53,7 @@ public function testProductSmallImageUrlWithExistingImage()
*/
public function testProductMediaGalleryEntries()
{
$this->markTestSkipped('https://github.com/magento/graphql-ce/issues/738');
$productSku = 'simple';
$query = <<<QUERY
{
Expand Down Expand Up @@ -78,13 +82,14 @@ public function testProductMediaGalleryEntries()
*/
private function checkImageExists(string $url): bool
{
// phpcs:disable Magento2.Functions.DiscouragedFunction
$connection = curl_init($url);
curl_setopt($connection, CURLOPT_HEADER, true);
curl_setopt($connection, CURLOPT_NOBODY, true);
curl_setopt($connection, CURLOPT_RETURNTRANSFER, 1);
curl_exec($connection);
$responseStatus = curl_getinfo($connection, CURLINFO_HTTP_CODE);

// phpcs:enable Magento2.Functions.DiscouragedFunction
return $responseStatus === 200 ? true : false;
}
}

0 comments on commit 44d7ff4

Please sign in to comment.