Skip to content

Commit cbc40cf

Browse files
committed
Tests coverage
1 parent 2167424 commit cbc40cf

File tree

2 files changed

+67
-2
lines changed

2 files changed

+67
-2
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,26 @@ public function testQueryAllFieldsSimpleProduct()
137137
sort_order
138138
}
139139
}
140+
... on CustomizableCheckboxOption {
141+
checkbox_option: value {
142+
option_type_id
143+
sku
144+
price
145+
price_type
146+
title
147+
sort_order
148+
}
149+
}
150+
... on CustomizableMultipleOption {
151+
multiple_option: value {
152+
option_type_id
153+
sku
154+
price
155+
price_type
156+
title
157+
sort_order
158+
}
159+
}
140160
...on CustomizableFileOption {
141161
product_sku
142162
file_option: value {
@@ -278,6 +298,7 @@ public function testQueryAllFieldsSimpleProduct()
278298
/**
279299
* @magentoApiDataFixture Magento/Catalog/_files/product_simple_with_media_gallery_entries.php
280300
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
301+
* @gro
281302
*/
282303
public function testQueryMediaGalleryEntryFieldsSimpleProduct()
283304
{
@@ -736,7 +757,7 @@ private function assertOptions($product, $actualResponse)
736757
$values = $option->getValues();
737758
/** @var \Magento\Catalog\Model\Product\Option\Value $value */
738759
$value = current($values);
739-
$findValueKeyName = $option->getType() === 'radio' ? 'radio_option' : 'drop_down_option';
760+
$findValueKeyName = $option->getType() . '_option';
740761
if ($value->getTitle() === $optionsArray[$findValueKeyName][0]['title']) {
741762
$match = true;
742763
}
@@ -756,7 +777,7 @@ private function assertOptions($product, $actualResponse)
756777
];
757778

758779
if (!empty($option->getValues())) {
759-
$valueKeyName = $option->getType() === 'radio' ? 'radio_option' : 'drop_down_option';
780+
$valueKeyName = $option->getType() . '_option';
760781
$value = current($optionsArray[$valueKeyName]);
761782
/** @var \Magento\Catalog\Model\Product\Option\Value $productValue */
762783
$productValue = current($option->getValues());

dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_full_option_set.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,50 @@
187187
'price_type' => 'percent',
188188
'sku' => 'sku2',
189189
'max_characters' => 20,
190+
],
191+
[
192+
'title' => 'multiple option',
193+
'type' => 'multiple',
194+
'is_require' => true,
195+
'sort_order' => 7,
196+
'values' => [
197+
[
198+
'title' => 'multiple option 1',
199+
'price' => 10,
200+
'price_type' => 'fixed',
201+
'sku' => 'multiple option 1 sku',
202+
'sort_order' => 1,
203+
],
204+
[
205+
'title' => 'multiple option 2',
206+
'price' => 20,
207+
'price_type' => 'fixed',
208+
'sku' => 'multiple option 2 sku',
209+
'sort_order' => 2,
210+
],
211+
],
212+
],
213+
[
214+
'title' => 'checkbox option',
215+
'type' => 'checkbox',
216+
'is_require' => true,
217+
'sort_order' => 6,
218+
'values' => [
219+
[
220+
'title' => 'checkbox option 1',
221+
'price' => 10,
222+
'price_type' => 'fixed',
223+
'sku' => 'checkbox option 1 sku',
224+
'sort_order' => 1,
225+
],
226+
[
227+
'title' => 'checkbox option 2',
228+
'price' => 20,
229+
'price_type' => 'fixed',
230+
'sku' => 'checkbox option 2 sku',
231+
'sort_order' => 2,
232+
],
233+
],
190234
]
191235
];
192236

0 commit comments

Comments
 (0)