@@ -73,7 +73,7 @@ public function testCMSContentProductListing(): void
73
73
'data-pb-style="E4B30DS"><div data-content-type="products" data-appearance="grid" ' .
74
74
'data-element="main">{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" ' .
75
75
'template="Magento_CatalogWidget::product/widget/content/grid.phtml" anchor_text="" id_path="" ' .
76
- 'show_pager="0" products_count="5" condition_option="category_ids" condition_option_value=" ' .$ categoryId
76
+ 'show_pager="0" products_count="5" condition_option="category_ids" condition_option_value=" ' . $ categoryId
77
77
.'"type_name="Catalog Products List" conditions_encoded="^[`1`:^[`aggregator`:`all`,`new_child`:``, ' .
78
78
'`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`value`:`1`^],`1--1`:^[`operator`:`==`, ' .
79
79
'`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`category_ids`, ' .
@@ -83,21 +83,20 @@ public function testCMSContentProductListing(): void
83
83
$ this ->pageRepository ->save ($ page );
84
84
85
85
$ productPositions = $ category ->getProductsPosition ();
86
- $ count = 3 ;
86
+ $ index = 2 ;
87
87
foreach ($ productPositions as $ productId => $ position ) {
88
- $ productPositions [$ productId ] = $ count ;
89
- $ count --;
88
+ $ productPositions [$ productId ] = $ index ;
89
+ $ index --;
90
90
}
91
- ksort ($ productPositions );
92
91
93
92
$ category ->setPostedProducts ($ productPositions );
94
93
$ category ->save ();
95
94
96
95
$ query = $ this ->getQuery ($ page ->getIdentifier (), ['title ' , 'content ' ]);
97
96
$ response = $ this ->graphQlQueryWithResponseHeaders ($ query );
98
- $ position1 = strpos ($ response ['body ' ]['cmsPage ' ]['content ' ], '/simple-product-with-price-10 .html ' );
99
- $ position2 = strpos ($ response ['body ' ]['cmsPage ' ]['content ' ], '/simple-product2 .html ' );
100
- $ position3 = strpos ($ response ['body ' ]['cmsPage ' ]['content ' ], '/simple-product-with-price-20 .html ' );
97
+ $ position1 = strpos ($ response ['body ' ]['cmsPage ' ]['content ' ], '/simple-product2 .html ' );
98
+ $ position2 = strpos ($ response ['body ' ]['cmsPage ' ]['content ' ], '/simple-product-with-price-20 .html ' );
99
+ $ position3 = strpos ($ response ['body ' ]['cmsPage ' ]['content ' ], '/simple-product-with-price-10 .html ' );
101
100
$ this ->assertTrue ($ position1 < $ position2 && $ position2 < $ position3 );
102
101
}
103
102
0 commit comments