Skip to content

Commit 60d2696

Browse files
committed
MC-33799: Stabilize Integration tests
1 parent ec90295 commit 60d2696

File tree

37 files changed

+152
-147
lines changed

37 files changed

+152
-147
lines changed

dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricingTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,53 +46,53 @@ protected function setUp(): void
4646
'AdvancedPricingSimple 1' => [
4747
[
4848
'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL,
49-
'value' => 300,
49+
'value' => '300.000000',
5050
'qty' => '10.0000',
5151
'percentage_value' => null
5252
],
5353
[
5454
'customer_group_id' => '1',
55-
'value' => 11,
55+
'value' => '11.000000',
5656
'qty' => '11.0000',
5757
'percentage_value' => null
5858
],
5959
[
6060
'customer_group_id' => '3',
61-
'value' => 14,
61+
'value' => '14.000000',
6262
'qty' => '14.0000',
6363
'percentage_value' => null
6464
],
6565
[
6666
'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL,
67-
'value' => 160,
67+
'value' => 160.5,
6868
'qty' => '20.0000',
69-
'percentage_value' => '50.0000'
69+
'percentage_value' => '50.00'
7070
]
7171
],
7272
'AdvancedPricingSimple 2' => [
7373
[
7474
'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL,
75-
'value' => 1000000,
75+
'value' => '1000000.000000',
7676
'qty' => '100.0000',
7777
'percentage_value' => null
7878
],
7979
[
8080
'customer_group_id' => '0',
81-
'value' => 12,
81+
'value' => '12.000000',
8282
'qty' => '12.0000',
8383
'percentage_value' => null
8484
],
8585
[
8686
'customer_group_id' => '2',
87-
'value' => 13,
87+
'value' => '13.000000',
8888
'qty' => '13.0000',
8989
'percentage_value' => null
9090
],
9191
[
9292
'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL,
93-
'value' => 327,
93+
'value' => 327.0,
9494
'qty' => '200.0000',
95-
'percentage_value' => '50.0000'
95+
'percentage_value' => '50.00'
9696
]
9797
]
9898
];
@@ -166,8 +166,8 @@ private function checkPercentageDiscount(
166166
$index
167167
) {
168168
$this->assertEquals(
169-
$this->expectedTierPrice[$sku][$index]['percentage_value'],
170-
$tierPrice->getExtensionAttributes()->getPercentageValue()
169+
(int)$this->expectedTierPrice[$sku][$index]['percentage_value'],
170+
(int)$tierPrice->getExtensionAttributes()->getPercentageValue()
171171
);
172172
$tierPrice->setData('percentage_value', $tierPrice->getExtensionAttributes()->getPercentageValue());
173173
}

dev/tests/integration/testsuite/Magento/Bundle/Controller/Adminhtml/Product/AbstractBundleProductSaveTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ private function prepareOptionByType(string $type, array $option): array
149149
private function prepareSelection(array $productIdsBySkus, array $selection): array
150150
{
151151
$staticData = [
152-
'price' => '10',
153-
'selection_qty' => '5',
152+
'price' => '10.000000',
153+
'selection_qty' => '5.0000',
154154
'selection_can_change_qty' => '0'
155155
];
156156
$selection['product_id'] = $productIdsBySkus[$selection['sku']];

dev/tests/integration/testsuite/Magento/Catalog/Console/Command/ProductAttributesCleanUpTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function testExecute()
7171
$this->tester->getDisplay()
7272
);
7373
$attribute = $this->getUnusedProductAttribute();
74-
$this->assertFalse($attribute);
74+
$this->assertEmpty($attribute);
7575
}
7676

7777
/**

dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTreeTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ public function testGetParentId()
117117

118118
public function testGetParentIds()
119119
{
120-
$this->assertEquals([], $this->_model->getParentIds());
120+
$this->assertEmpty($this->_model->getParentIds());
121121
$this->_model->unsetData();
122122
$this->_model->load(4);
123-
$this->assertContains(3, $this->_model->getParentIds());
124-
$this->assertNotContains(4, $this->_model->getParentIds());
123+
$this->assertTrue(in_array(3, $this->_model->getParentIds()));
124+
$this->assertFalse(in_array(4, $this->_model->getParentIds()));
125125
}
126126

127127
public function testGetChildren()
@@ -173,9 +173,9 @@ public function testGetLevel()
173173
public function testGetAnchorsAbove()
174174
{
175175
$this->_model->load(4);
176-
$this->assertContains(3, $this->_model->getAnchorsAbove());
176+
$this->assertTrue(in_array(3, $this->_model->getAnchorsAbove()));
177177
$this->_model->load(5);
178-
$this->assertContains(4, $this->_model->getAnchorsAbove());
178+
$this->assertTrue(in_array(4, $this->_model->getAnchorsAbove()));
179179
}
180180

181181
public function testGetParentCategories()

dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/PriceTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function testAfterSave()
105105
$product->setStoreId($globalStoreId);
106106
$product->getResource()->save($product);
107107
$product = $this->productRepository->get('simple', false, $globalStoreId, true);
108-
$this->assertEquals('9.99', $product->getPrice());
108+
$this->assertEquals('9.990000', $product->getPrice());
109109
}
110110

111111
/**
@@ -140,10 +140,10 @@ public function testAfterSaveWithDifferentStores()
140140
$this->assertEquals(10, $product->getPrice());
141141

142142
$product = $this->productRepository->get('simple', false, $secondStoreId, true);
143-
$this->assertEquals('9.99', $product->getPrice());
143+
$this->assertEquals('9.990000', $product->getPrice());
144144

145145
$product = $this->productRepository->get('simple', false, $thirdStoreId, true);
146-
$this->assertEquals('9.99', $product->getPrice());
146+
$this->assertEquals('9.990000', $product->getPrice());
147147
}
148148

149149
/**
@@ -179,10 +179,10 @@ public function testAfterSaveWithSameCurrency()
179179
$this->assertEquals(10, $product->getPrice());
180180

181181
$product = $this->productRepository->get('simple', false, $secondStoreId, true);
182-
$this->assertEquals('9.99', $product->getPrice());
182+
$this->assertEquals('9.990000', $product->getPrice());
183183

184184
$product = $this->productRepository->get('simple', false, $thirdStoreId, true);
185-
$this->assertEquals('9.99', $product->getPrice());
185+
$this->assertEquals('9.990000', $product->getPrice());
186186
}
187187

188188
/**
@@ -218,10 +218,10 @@ public function testAfterSaveWithUseDefault()
218218
$this->assertEquals(10, $product->getPrice());
219219

220220
$product = $this->productRepository->get('simple', false, $secondStoreId, true);
221-
$this->assertEquals('9.99', $product->getPrice());
221+
$this->assertEquals('9.990000', $product->getPrice());
222222

223223
$product = $this->productRepository->get('simple', false, $thirdStoreId, true);
224-
$this->assertEquals('9.99', $product->getPrice());
224+
$this->assertEquals('9.990000', $product->getPrice());
225225

226226
$product->setStoreId($thirdStoreId);
227227
$product->setPrice(null);

dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributePriceTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public function testNegativeValue(): void
4444
/**
4545
* @dataProvider productProvider
4646
* @param string $productSku
47+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4748
*/
4849
public function testDefaultValue(string $productSku): void
4950
{
@@ -88,6 +89,6 @@ protected function getAttributeCode(): string
8889
*/
8990
protected function getDefaultAttributeValue(): string
9091
{
91-
return '100';
92+
return '100.000000';
9293
}
9394
}

dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/CreateHandlerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ public function testExecuteWithImageDuplicate(): void
108108
public function testExecuteWithIllegalFilename(string $imageFileName): void
109109
{
110110
$this->expectException(\Magento\Framework\Exception\FileSystemException::class);
111-
$this->expectExceptionMessageMatches('"/^((?!\\.\\.\\/).)*$/"');
111+
$this->expectExceptionMessageMatches('".+ file doesn\'t exist."');
112+
$this->expectExceptionMessageMatches('/^((?!\.\.\/).)*$/');
112113

113114
$data = [
114115
'media_gallery' => ['images' => ['image' => ['file' => $imageFileName, 'label' => 'New image']]],

dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/_files/eav_expected_data_output.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
"product" => [
1010
"name" => "Simple Product",
1111
"sku" => "simple",
12-
"price" => "10.0000",
12+
"price" => "10.00",
1313
"tax_class_id" => "0",
1414
"quantity_and_stock_status" => [
1515
"is_in_stock" => true,
1616
"qty" => 100.0
1717
],
18-
"weight" => "1.0000",
18+
"weight" => "1.000000",
1919
"visibility" => "4",
2020
"category_ids" => [
2121
"2"
@@ -36,27 +36,27 @@
3636
"website_id" => "0",
3737
"all_groups" => "1",
3838
"cust_group" => 32000,
39-
"price" => "8.0000",
39+
"price" => "8.000000",
4040
"price_qty" => "2.0000",
41-
"website_price" => "8.0000",
41+
"website_price" => "8.000000",
4242
"price_id" => "__placeholder__"
4343
],
4444
[
4545
"website_id" => "0",
4646
"all_groups" => "0",
4747
"cust_group" => "0",
48-
"price" => "5.0000",
48+
"price" => "5.000000",
4949
"price_qty" => "3.0000",
50-
"website_price" => "5.0000",
50+
"website_price" => "5.000000",
5151
"price_id" => "__placeholder__"
5252
],
5353
[
5454
"website_id" => "0",
5555
"all_groups" => "1",
5656
"cust_group" => 32000,
57-
"price" => "5.0000",
57+
"price" => "5.000000",
5858
"price_qty" => "5.0000",
59-
"website_price" => "5.0000",
59+
"website_price" => "5.000000",
6060
"price_id" => "__placeholder__"
6161
]
6262
],
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
sku,website_code,store_view_code,attribute_set_code,product_type,name,description,short_description,weight,product_online,visibility,product_websites,categories,price,special_price,special_price_from_date,special_price_to_date,tax_class_name,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,additional_images,additional_image_labels,configurable_variation_labels,configurable_variations,bundle_price_type,bundle_sku_type,bundle_weight_type,bundle_values,downloadble_samples,downloadble_links,associated_skus,related_skus,crosssell_skus,upsell_skus,custom_options,additional_attributes,manage_stock,is_in_stock,qty,out_of_stock_qty,is_qty_decimal,allow_backorders,min_cart_qty,max_cart_qty,notify_on_stock_below,qty_increments,enable_qty_increments,is_decimal_divided,new_from_date,new_to_date,gift_message_available,created_at,updated_at,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_price,msrp_display_actual_price_type,map_enabled
2-
simple,base,,Default,simple,New Product,,,9,1,"Catalog, Search",base,,10,,,,Taxable Goods,new-product,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title,type=field,required=1,sku=1-text,price=0,price_type=fixed,max_characters=10|name=Test Date and Time Title,type=date_time,required=1,price=2,sku=2-date|name=Test Select,type=drop_down,required=1,price=3,option_title=Option 1,sku=3-1-select|name=Test Select,type=drop_down,required=1,price=3,option_title=Option 2,sku=3-2-select|name=Test Radio,type=radio,required=1,price=3,option_title=Option 1,sku=4-1-radio|name=Test Radio,type=radio,required=1,price=3,option_title=Option 2,sku=4-2-radio",,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,
2+
simple,base,,Default,simple,New Product,,,9,1,"Catalog, Search",base,,10,,,,Taxable Goods,new-product,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title,type=field,required=1,sku=1-text,price=0.000,price_type=fixed,max_characters=10|name=Test Date and Time Title,type=date_time,required=1,price=2.0000,sku=2-date|name=Test Select,type=drop_down,required=1,price=3.0000,option_title=Option 1,sku=3-1-select|name=Test Select,type=drop_down,required=1,price=3.0000,option_title=Option 2,sku=3-2-select|name=Test Radio,type=radio,required=1,price=3.0000,option_title=Option 1,sku=4-1-radio|name=Test Radio,type=radio,required=1,price=3.0000,option_title=Option 2,sku=4-2-radio",,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,

dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options_and_multiple_store_views.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
sku,website_code,store_view_code,attribute_set_code,product_type,name,description,short_description,weight,product_online,visibility,product_websites,categories,price,special_price,special_price_from_date,special_price_to_date,tax_class_name,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,additional_images,additional_image_labels,configurable_variation_labels,configurable_variations,bundle_price_type,bundle_sku_type,bundle_weight_type,bundle_values,downloadble_samples,downloadble_links,associated_skus,related_skus,crosssell_skus,upsell_skus,custom_options,additional_attributes,manage_stock,is_in_stock,qty,out_of_stock_qty,is_qty_decimal,allow_backorders,min_cart_qty,max_cart_qty,notify_on_stock_below,qty_increments,enable_qty_increments,is_decimal_divided,new_from_date,new_to_date,gift_message_available,created_at,updated_at,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_price,msrp_display_actual_price_type,map_enabled
2-
simple,base,,Default,simple,New Product,,,9,1,"Catalog, Search","base,secondwebsite",,10,,,,Taxable Goods,new-product,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title,type=field,required=1,sku=1-text,price=100|name=Test Date and Time Title,type=date_time,required=1,sku=2-date,price=200|name=Test Select,type=drop_down,required=1,sku=3-1-select,price=310,option_title=Select Option 1|name=Test Select,type=drop_down,required=1,sku=3-2-select,price=320,option_title=Select Option 2|name=Test Checkbox,type=checkbox,required=1,sku=4-1-select,price=410,option_title=Checkbox Option 1|name=Test Checkbox,type=checkbox,required=1,sku=4-2-select,price=420,option_title=Checkbox Option 2|name=Test Radio,type=radio,required=1,sku=5-1-radio,price=510,option_title=Radio Option 1|name=Test Radio,type=radio,required=1,sku=5-2-radio,price=520,option_title=Radio Option 2",,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,
2+
simple,base,,Default,simple,New Product,,,9,1,"Catalog, Search","base,secondwebsite",,10,,,,Taxable Goods,new-product,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title,type=field,required=1,sku=1-text,price=100.000000|name=Test Date and Time Title,type=date_time,required=1,sku=2-date,price=200.000000|name=Test Select,type=drop_down,required=1,sku=3-1-select,price=310.000000,option_title=Select Option 1|name=Test Select,type=drop_down,required=1,sku=3-2-select,price=320.000000,option_title=Select Option 2|name=Test Checkbox,type=checkbox,required=1,sku=4-1-select,price=410.000000,option_title=Checkbox Option 1|name=Test Checkbox,type=checkbox,required=1,sku=4-2-select,price=420.000000,option_title=Checkbox Option 2|name=Test Radio,type=radio,required=1,sku=5-1-radio,price=510.000000,option_title=Radio Option 1|name=Test Radio,type=radio,required=1,sku=5-2-radio,price=520.000000,option_title=Radio Option 2",,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,
33
simple,,default,Default,simple,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title_default,type=field,sku=1-text|name=Test Date and Time Title_default,type=date_time,sku=2-date|name=Test Select_default,type=drop_down,sku=3-1-select,option_title=Select Option 1_default|name=Test Select_default,type=drop_down,sku=3-2-select,option_title=Select Option 2_default|name=Test Checkbox_default,type=checkbox,sku=4-1-select,option_title=Checkbox Option 1_default|name=Test Checkbox_default,type=checkbox,sku=4-2-select,option_title=Checkbox Option 2_default|name=Test Radio_default,type=radio,sku=5-1-radio,option_title=Radio Option 1_default|name=Test Radio_default,type=radio,sku=5-2-radio,option_title=Radio Option 2_default",,,,,,,,,,,,,,,,,,,,,,,,,,,
4-
simple,,secondstore,Default,simple,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title_fixture_second_store,type=field,sku=1-text,price=101|name=Test Date and Time Title_fixture_second_store,type=date_time,sku=2-date,price=201|name=Test Select_fixture_second_store,type=drop_down,sku=3-1-select,price=311,option_title=Select Option 1_fixture_second_store|name=Test Select_fixture_second_store,type=drop_down,sku=3-2-select,price=321,option_title=Select Option 2_fixture_second_store|name=Test Checkbox_second_store,type=checkbox,sku=4-1-select,price=411,option_title=Checkbox Option 1_second_store|name=Test Checkbox_second_store,type=checkbox,sku=4-2-select,price=421,option_title=Checkbox Option 2_second_store|name=Test Radio_fixture_second_store,type=radio,sku=5-1-radio,price=511,option_title=Radio Option 1_fixture_second_store|name=Test Radio_fixture_second_store,type=radio,sku=5-2-radio,price=521,option_title=Radio Option 2_fixture_second_store",,,,,,,,,,,,,,,,,,,,,,,,,,,
4+
simple,,secondstore,Default,simple,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title_fixture_second_store,type=field,sku=1-text,price=101.000000|name=Test Date and Time Title_fixture_second_store,type=date_time,sku=2-date,price=201.000000|name=Test Select_fixture_second_store,type=drop_down,sku=3-1-select,price=311.000000,option_title=Select Option 1_fixture_second_store|name=Test Select_fixture_second_store,type=drop_down,sku=3-2-select,price=321.000000,option_title=Select Option 2_fixture_second_store|name=Test Checkbox_second_store,type=checkbox,sku=4-1-select,price=411.000000,option_title=Checkbox Option 1_second_store|name=Test Checkbox_second_store,type=checkbox,sku=4-2-select,price=421.000000,option_title=Checkbox Option 2_second_store|name=Test Radio_fixture_second_store,type=radio,sku=5-1-radio,price=511.000000,option_title=Radio Option 1_fixture_second_store|name=Test Radio_fixture_second_store,type=radio,sku=5-2-radio,price=521.000000,option_title=Radio Option 2_fixture_second_store",,,,,,,,,,,,,,,,,,,,,,,,,,,
55
newprod2,base,secondstore,Default,configurable,New Product 2,,,9,1,"Catalog, Search","base,secondwebsite",,10,,,,Taxable Goods,new-product-2,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,
66
newprod3,base,,Default,configurable,New Product 3,,,9,1,"Catalog, Search","base,secondwebsite",,10,,,,Taxable Goods,new-product-3,,,,,,,,,,,,,,,,,,,,,,,,"name=Line 1,type=field,max_characters=30,required=1,option_title=Line 1|name=Line 2,type=field,max_characters=30,required=0,option_title=Line 2",,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,
77
newprod4,base,secondstore,Default,configurable,New Product 4,,,9,1,"Catalog, Search","base,secondwebsite",,10,,,,Taxable Goods,new-product-4,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,

0 commit comments

Comments
 (0)