Skip to content

Commit b75e66d

Browse files
committed
PB-261: Add Missing Integration P0-P1 Tests For Products
- fix static issues in tests
1 parent 5ead4f1 commit b75e66d

File tree

2 files changed

+55
-17
lines changed

2 files changed

+55
-17
lines changed

dev/tests/integration/testsuite/Magento/PageBuilder/Model/Catalog/ProductTotalsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function productDataProvider()
7575
]
7676
], [0, 0, 0, 0]
7777
],
78-
[ // #1 category with 16 products, 3 disabled, 3 not visible (but 2 not visible disabled), 2 out of stock (1 oos disabled
78+
[ // #1 category with 16 products, 3 disabled, 3 not visible (2 disabled), 2 out of stock (1 disabled)
7979
['1' => [
8080
'aggregator' => 'all',
8181
'new_child' => '',

dev/tests/integration/testsuite/Magento/PageBuilder/Model/Catalog/SortingTest.php

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ protected function setUp()
6565

6666
/**
6767
* @param array $productSortData
68-
* @dataProvider productSortDataProvider
68+
* @dataProvider productSortDataProvider1
69+
* @dataProvider productSortDataProvider2
70+
* @dataProvider productSortDataProvider3
6971
* @magentoDataFixture Magento/PageBuilder/_files/catalog_sorting/products.php
7072
* @magentoDataFixture Magento/PageBuilder/_files/catalog_sorting/bundle_product.php
7173
* @magentoDataFixture Magento/PageBuilder/_files/catalog_sorting/configurable_products.php
@@ -81,20 +83,26 @@ public function testSortOptions(array $productSortData)
8183
$this->productList->setData(
8284
[
8385
'store_id' => 1,
84-
'conditions_encoded' => '^[
85-
`1`:^[
86-
`aggregator`:`all`,
87-
`new_child`:``,
88-
`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,
89-
`value`:`1`
90-
^],
91-
`1--1`:^[
92-
`operator`:`()`,
93-
`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,
94-
`attribute`:`sku`,
95-
`value`:`B_PB_PRODUCT,a_pb_product,C_PB_PRODUCT,1_PB_PRODUCT,PB_PRODUCT_CPR,PB_VIRTUAL_PRODUCT,simple_second_website,simple1,simple2,simple3,bundle_product,configurable,simple_11,simple_21,gift-card,grouped,simple_100000001,simple_100000002,simple-with-fpt,downloadable-product-price-on-product,downloadable-product-price-on-link`
96-
^]
97-
^]',
86+
'conditions_encoded' => json_encode(
87+
[
88+
'1' => [
89+
'aggregator' => 'all',
90+
'new_child' => '',
91+
'type' => \Magento\CatalogWidget\Model\Rule\Condition\Combine::class,
92+
'value' => 1
93+
],
94+
'1--1' => [
95+
'operator' => '()',
96+
'type' => \Magento\CatalogWidget\Model\Rule\Condition\Product::class,
97+
'attribute' => 'sku',
98+
'value' => 'B_PB_PRODUCT,a_pb_product,C_PB_PRODUCT,1_PB_PRODUCT,PB_PRODUCT_CPR,' .
99+
'PB_VIRTUAL_PRODUCT,simple_second_website,simple1,simple2,simple3,bundle_product,' .
100+
'configurable,simple_11,simple_21,gift-card,grouped,simple_100000001,' .
101+
'simple_100000002,simple-with-fpt,downloadable-product-price-on-product,' .
102+
'downloadable-product-price-on-link'
103+
]
104+
]
105+
),
98106
'products_count' => 99
99107
]
100108
);
@@ -125,7 +133,7 @@ public function testSortOptions(array $productSortData)
125133
*
126134
* @return array
127135
*/
128-
public function productSortDataProvider() : array
136+
public function productSortDataProvider1() : array
129137
{
130138
return [
131139
[
@@ -206,6 +214,21 @@ public function productSortDataProvider() : array
206214
'a_pb_product',
207215
'1_PB_PRODUCT'
208216
],
217+
],
218+
]
219+
];
220+
}
221+
222+
/**
223+
* Provide sorting rule and expected order of SKUs once sort is applied
224+
*
225+
* @return array
226+
*/
227+
public function productSortDataProvider2() : array
228+
{
229+
return [
230+
[
231+
[
209232
'sku_ascending' => [
210233
'1_PB_PRODUCT',
211234
'a_pb_product',
@@ -282,6 +305,21 @@ public function productSortDataProvider() : array
282305
'grouped',
283306
'gift-card'
284307
],
308+
],
309+
]
310+
];
311+
}
312+
313+
/**
314+
* Provide sorting rule and expected order of SKUs once sort is applied
315+
*
316+
* @return array
317+
*/
318+
public function productSortDataProvider3() : array
319+
{
320+
return [
321+
[
322+
[
285323
'price_high_to_low' => [
286324
'bundle_product',
287325
'1_PB_PRODUCT',

0 commit comments

Comments
 (0)