|
1 | 1 | <?php |
2 | 2 | /** |
3 | | - * Copyright 2019 Adobe |
4 | | - * ll Rights Reserved. |
| 3 | + * Copyright © Magento, Inc. All rights reserved. |
| 4 | + * See COPYING.txt for license details. |
5 | 5 | */ |
6 | 6 | declare(strict_types=1); |
7 | 7 |
|
@@ -83,80 +83,6 @@ public function testQueryDisableRelatedProduct() |
83 | 83 | self::assertCount(0, $relatedProducts); |
84 | 84 | } |
85 | 85 |
|
86 | | - /** |
87 | | - * @magentoApiDataFixture Magento/Catalog/_files/products_related_disabled.php |
88 | | - * @magentoConfigFixture default/cataloginventory/options/show_out_of_stock 1 |
89 | | - */ |
90 | | - public function testQueryDisableRelatedProductWithShowOutOfStock() |
91 | | - { |
92 | | - $productSku = 'simple_with_cross'; |
93 | | - |
94 | | - $query = <<<QUERY |
95 | | -{ |
96 | | - products(filter: {sku: {eq: "{$productSku}"}}) |
97 | | - { |
98 | | - items { |
99 | | - related_products |
100 | | - { |
101 | | - sku |
102 | | - name |
103 | | - url_key |
104 | | - } |
105 | | - } |
106 | | - } |
107 | | -} |
108 | | -QUERY; |
109 | | - $response = $this->graphQlQuery($query); |
110 | | - |
111 | | - self::assertArrayHasKey('products', $response); |
112 | | - self::assertArrayHasKey('items', $response['products']); |
113 | | - self::assertCount(1, $response['products']['items']); |
114 | | - self::assertArrayHasKey(0, $response['products']['items']); |
115 | | - self::assertArrayHasKey('related_products', $response['products']['items'][0]); |
116 | | - $relatedProducts = $response['products']['items'][0]['related_products']; |
117 | | - self::assertCount(0, $relatedProducts); |
118 | | - } |
119 | | - |
120 | | - /** |
121 | | - * @magentoApiDataFixture Magento/Catalog/_files/products_crosssell.php |
122 | | - */ |
123 | | - public function testQueryCrossSellProducts() |
124 | | - { |
125 | | - $productSku = 'simple_with_cross'; |
126 | | - |
127 | | - $query = <<<QUERY |
128 | | -{ |
129 | | - products(filter: {sku: {eq: "{$productSku}"}}) |
130 | | - { |
131 | | - items { |
132 | | - crosssell_products |
133 | | - { |
134 | | - sku |
135 | | - name |
136 | | - url_key |
137 | | - } |
138 | | - } |
139 | | - } |
140 | | -} |
141 | | -QUERY; |
142 | | - $response = $this->graphQlQuery($query); |
143 | | - |
144 | | - self::assertArrayHasKey('products', $response); |
145 | | - self::assertArrayHasKey('items', $response['products']); |
146 | | - self::assertCount(1, $response['products']['items']); |
147 | | - self::assertArrayHasKey(0, $response['products']['items']); |
148 | | - self::assertArrayHasKey('crosssell_products', $response['products']['items'][0]); |
149 | | - $crossSellProducts = $response['products']['items'][0]['crosssell_products']; |
150 | | - self::assertCount(1, $crossSellProducts); |
151 | | - $crossSellProduct = $crossSellProducts[0]; |
152 | | - self::assertArrayHasKey('sku', $crossSellProduct); |
153 | | - self::assertArrayHasKey('name', $crossSellProduct); |
154 | | - self::assertArrayHasKey('url_key', $crossSellProduct); |
155 | | - self::assertEquals($crossSellProduct['sku'], 'simple'); |
156 | | - self::assertEquals($crossSellProduct['name'], 'Simple Cross Sell'); |
157 | | - self::assertEquals($crossSellProduct['url_key'], 'simple-cross-sell'); |
158 | | - } |
159 | | - |
160 | 86 | /** |
161 | 87 | * @magentoApiDataFixture Magento/Catalog/_files/products_upsell.php |
162 | 88 | */ |
|
0 commit comments