Skip to content

Commit 14b5ed4

Browse files
author
Oleksandr Manchenko
committed
MTA-548: Re-factor Tests for Create Products
- Removed deprecated product fixture call via FixtureFactory
1 parent 09400ec commit 14b5ed4

File tree

7 files changed

+113
-5
lines changed

7 files changed

+113
-5
lines changed

dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,44 @@ protected function getPreset($name)
638638
],
639639
],
640640
],
641+
642+
'bundle_required' => [
643+
'bundle_options' => [
644+
[
645+
'title' => 'Drop-down Option',
646+
'type' => 'Drop-down',
647+
'required' => 'Yes',
648+
'assigned_products' => [
649+
[
650+
'search_data' => [
651+
'name' => '%product_name%',
652+
],
653+
'data' => [
654+
'selection_price_value' => 10.00,
655+
'selection_price_type' => 'Fixed',
656+
'selection_qty' => 1,
657+
],
658+
],
659+
[
660+
'search_data' => [
661+
'name' => '%product_name%',
662+
],
663+
'data' => [
664+
'selection_price_value' => 20.00,
665+
'selection_price_type' => 'Fixed',
666+
'selection_qty' => 1,
667+
]
668+
],
669+
],
670+
],
671+
],
672+
'products' => [
673+
[
674+
'catalogProductSimple::simple',
675+
'catalogProductVirtual::for_bundle_required',
676+
],
677+
],
678+
],
641679
];
642680
if (!isset($presets[$name])) {
643681
throw new \InvalidArgumentException(

dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/CheckoutData.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,19 @@ protected function getPreset($name)
304304
],
305305
],
306306
],
307+
'bundle_required' => [
308+
'options' => [
309+
'bundle_options' => [
310+
[
311+
'title' => 'Drop-down Option',
312+
'type' => 'Drop-down',
313+
'value' => [
314+
'name' => 'Simple Product',
315+
],
316+
],
317+
],
318+
],
319+
],
307320
];
308321
return isset($presets[$name]) ? $presets[$name] : null;
309322
}

dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,31 @@
177177
<item name="preset" xsi:type="string">two_options_assigned_products_without_category</item>
178178
</field>
179179
</dataset>
180+
181+
<dataset name="bundle_required">
182+
<field name="name" xsi:type="string">Bundle fixed product %isolation%</field>
183+
<field name="url_key" xsi:type="string">bundle-fixed-product-%isolation%</field>
184+
<field name="sku" xsi:type="string">sku_bundle_fixed_product_%isolation%</field>
185+
<field name="sku_type" xsi:type="string">Fixed</field>
186+
<field name="price_type" xsi:type="string">Fixed</field>
187+
<field name="price" xsi:type="array">
188+
<item name="value" xsi:type="string">100</item>
189+
</field>
190+
<field name="tax_class_id" xsi:type="array">
191+
<item name="dataSet" xsi:type="string">taxable_goods</item>
192+
</field>
193+
<field name="weight" xsi:type="string">1</field>
194+
<field name="weight_type" xsi:type="string">Fixed</field>
195+
<field name="website_ids" xsi:type="array">
196+
<item name="0" xsi:type="string">Main Website</item>
197+
</field>
198+
<field name="shipment_type" xsi:type="string">Separately</field>
199+
<field name="bundle_selections" xsi:type="array">
200+
<item name="preset" xsi:type="string">bundle_required</item>
201+
</field>
202+
<field name="checkout_data" xsi:type="array">
203+
<item name="preset" xsi:type="string">bundle_required</item>
204+
</field>
205+
</dataset>
180206
</storage>
181207
</repository>

dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,32 @@
136136
<item name="preset" xsi:type="string">product_50_dollar</item>
137137
</field>
138138
</dataset>
139+
140+
<dataset name="for_bundle_required">
141+
<field name="tax_class_id" xsi:type="array">
142+
<item name="dataSet" xsi:type="string">taxable_goods</item>
143+
</field>
144+
<field name="website_ids" xsi:type="array">
145+
<item name="0" xsi:type="string">Main Website</item>
146+
</field>
147+
<field name="is_virtual" xsi:type="string">Yes</field>
148+
<field name="url_key" xsi:type="string">virtual-product%isolation%</field>
149+
<field name="name" xsi:type="string">Virtual product %isolation%</field>
150+
<field name="sku" xsi:type="string">sku_virtual_product_%isolation%</field>
151+
<field name="quantity_and_stock_status" xsi:type="array">
152+
<item name="qty" xsi:type="string">1000</item>
153+
<item name="is_in_stock" xsi:type="string">In Stock</item>
154+
</field>
155+
<field name="stock_data" xsi:type="array">
156+
<item name="manage_stock" xsi:type="string">No</item>
157+
</field>
158+
<field name="price" xsi:type="array">
159+
<item name="value" xsi:type="string">15</item>
160+
<item name="preset" xsi:type="string">-</item>
161+
</field>
162+
<field name="checkout_data" xsi:type="array">
163+
<item name="preset" xsi:type="string">order_default</item>
164+
</field>
165+
</dataset>
139166
</storage>
140167
</repository>

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/CheckoutData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ protected function getPreset($name)
177177
],
178178
'qty' => 1,
179179
],
180-
'two_options_one_two_dollars' => [
180+
'configurable_required' => [
181181
'options' => [
182182
'configurable_options' => [
183183
[

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProductInjectable/ConfigurableAttributesData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ class ConfigurableAttributesData implements FixtureInterface
628628
],
629629
],
630630

631-
'two_options_one_two_dollars' => [
631+
'configurable_required' => [
632632
'attributes_data' => [
633633
'attribute_key_0' => [
634634
'options' => [

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProductInjectable.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@
223223
<item name="dataSet" xsi:type="string">taxable_goods</item>
224224
</field>
225225
<field name="weight" xsi:type="string">1</field>
226+
<field name="quantity_and_stock_status" xsi:type="array">
227+
<item name="qty" xsi:type="string">1</item>
228+
<item name="is_in_stock" xsi:type="string">In Stock</item>
229+
</field>
226230
<field name="category_ids" xsi:type="array">
227231
<item name="presets" xsi:type="string">default_subcategory</item>
228232
</field>
@@ -302,7 +306,7 @@
302306
<field name="msrp_display_actual_price_type" xsi:type="string">On Gesture</field>
303307
</dataset>
304308

305-
<dataset name="two_options_one_two_dollars">
309+
<dataset name="configurable_required">
306310
<field name="name" xsi:type="string">Configurable product %isolation%</field>
307311
<field name="url_key" xsi:type="string">test-configurable-product-%isolation%</field>
308312
<field name="sku" xsi:type="string">sku_configurable_product_%isolation%</field>
@@ -324,13 +328,13 @@
324328
<item name="0" xsi:type="string">Main Website</item>
325329
</field>
326330
<field name="configurable_attributes_data" xsi:type="array">
327-
<item name="preset" xsi:type="string">two_options_one_two_dollars</item>
331+
<item name="preset" xsi:type="string">configurable_required</item>
328332
</field>
329333
<field name="attribute_set_id" xsi:type="array">
330334
<item name="dataSet" xsi:type="string">custom_attribute_set</item>
331335
</field>
332336
<field name="checkout_data" xsi:type="array">
333-
<item name="preset" xsi:type="string">two_options_one_two_dollars</item>
337+
<item name="preset" xsi:type="string">configurable_required</item>
334338
</field>
335339
</dataset>
336340
</storage>

0 commit comments

Comments
 (0)