@@ -89,10 +89,18 @@ protected function setUp()
89
89
* @param string $sortBy
90
90
* @param string $direction
91
91
* @param array $expectation
92
+ * @param string|null $incompleteReason
92
93
* @return void
93
94
*/
94
- public function testProductListSortOrder (string $ sortBy , string $ direction , array $ expectation ): void
95
- {
95
+ public function testProductListSortOrder (
96
+ string $ sortBy ,
97
+ string $ direction ,
98
+ array $ expectation ,
99
+ string $ incompleteReason = null
100
+ ): void {
101
+ if ($ incompleteReason ) {
102
+ $ this ->markTestIncomplete ($ incompleteReason );
103
+ }
96
104
$ category = $ this ->updateCategorySortBy ('Category 1 ' , Store::DEFAULT_STORE_ID , $ sortBy );
97
105
$ this ->renderBlock ($ category , $ direction );
98
106
$ this ->assertBlockSorting ($ sortBy , $ expectation );
@@ -104,10 +112,18 @@ public function testProductListSortOrder(string $sortBy, string $direction, arra
104
112
* @param string $sortBy
105
113
* @param string $direction
106
114
* @param array $expectation
115
+ * @param string|null $incompleteReason
107
116
* @return void
108
117
*/
109
- public function testProductListSortOrderWithConfig (string $ sortBy , string $ direction , array $ expectation ): void
110
- {
118
+ public function testProductListSortOrderWithConfig (
119
+ string $ sortBy ,
120
+ string $ direction ,
121
+ array $ expectation ,
122
+ string $ incompleteReason = null
123
+ ): void {
124
+ if ($ incompleteReason ) {
125
+ $ this ->markTestIncomplete ($ incompleteReason );
126
+ }
111
127
$ this ->assertProductListSortOrderWithConfig ($ sortBy , $ direction , $ expectation );
112
128
}
113
129
@@ -147,17 +163,20 @@ public function productListSortOrderDataProvider(): array
147
163
'direction ' => 'desc ' ,
148
164
'expectation ' => ['simple3 ' , 'simple2 ' , 'simple1 ' ],
149
165
],
150
- // TODO: Skipped MC-33231
151
- //'default_order_custom_attribute_asc' => [
152
- // 'sort' => 'test_configurable',
153
- // 'direction' => 'asc',
154
- // 'expectation' => ['simple1', 'simple3', 'simple2'],
155
- //],
156
- //'default_order_custom_attribute_desc' => [
157
- // 'sort' => 'test_configurable',
158
- // 'direction' => 'desc',
159
- // 'expectation' => ['simple3', 'simple2', 'simple1'],
160
- //],
166
+ 'default_order_custom_attribute_asc ' => [
167
+ 'sort ' => 'test_configurable ' ,
168
+ 'direction ' => 'asc ' ,
169
+ 'expectation ' => ['simple1 ' , 'simple3 ' , 'simple2 ' ],
170
+ 'incomplete_reason ' => 'MC-33825: '
171
+ . 'Stabilize skipped test cases for Integration SortingTest with elasticsearch ' ,
172
+ ],
173
+ 'default_order_custom_attribute_desc ' => [
174
+ 'sort ' => 'test_configurable ' ,
175
+ 'direction ' => 'desc ' ,
176
+ 'expectation ' => ['simple3 ' , 'simple2 ' , 'simple1 ' ],
177
+ 'incomplete_reason ' => 'MC-33825: '
178
+ . 'Stabilize skipped test cases for Integration SortingTest with elasticsearch ' ,
179
+ ],
161
180
];
162
181
}
163
182
@@ -169,14 +188,19 @@ public function productListSortOrderDataProvider(): array
169
188
* @param string $direction
170
189
* @param array $expectation
171
190
* @param string $defaultSortBy
191
+ * @param string|null $incompleteReason
172
192
* @return void
173
193
*/
174
194
public function testProductListSortOrderOnStoreView (
175
195
string $ sortBy ,
176
196
string $ direction ,
177
197
array $ expectation ,
178
- string $ defaultSortBy
198
+ string $ defaultSortBy ,
199
+ string $ incompleteReason = null
179
200
): void {
201
+ if ($ incompleteReason ) {
202
+ $ this ->markTestIncomplete ($ incompleteReason );
203
+ }
180
204
$ secondStoreId = (int )$ this ->storeManager ->getStore ('fixture_second_store ' )->getId ();
181
205
$ this ->updateCategorySortBy ('Category 1 ' , Store::DEFAULT_STORE_ID , $ defaultSortBy );
182
206
$ category = $ this ->updateCategorySortBy ('Category 1 ' , $ secondStoreId , $ sortBy );
@@ -192,14 +216,19 @@ public function testProductListSortOrderOnStoreView(
192
216
* @param string $direction
193
217
* @param array $expectation
194
218
* @param string $defaultSortBy
219
+ * @param string|null $incompleteReason,
195
220
* @return void
196
221
*/
197
222
public function testProductListSortOrderWithConfigOnStoreView (
198
223
string $ sortBy ,
199
224
string $ direction ,
200
225
array $ expectation ,
201
- string $ defaultSortBy
226
+ string $ defaultSortBy ,
227
+ string $ incompleteReason = null
202
228
): void {
229
+ if ($ incompleteReason ) {
230
+ $ this ->markTestIncomplete ($ incompleteReason );
231
+ }
203
232
$ this ->objectManager ->removeSharedInstance (Config::class);
204
233
$ secondStoreId = (int )$ this ->storeManager ->getStore ('fixture_second_store ' )->getId ();
205
234
$ this ->scopeConfig ->setValue (
@@ -225,20 +254,60 @@ public function testProductListSortOrderWithConfigOnStoreView(
225
254
*/
226
255
public function productListSortOrderDataProviderOnStoreView (): array
227
256
{
228
- return array_merge_recursive (
229
- $ this ->productListSortOrderDataProvider (),
230
- [
231
- 'default_order_price_asc ' => ['default_sort ' => 'position ' ],
232
- 'default_order_price_desc ' => ['default_sort ' => 'position ' ],
233
- 'default_order_position_asc ' => ['default_sort ' => 'price ' ],
234
- 'default_order_position_desc ' => ['default_sort ' => 'price ' ],
235
- 'default_order_name_asc ' => ['default_sort ' => 'price ' ],
236
- 'default_order_name_desc ' => ['default_sort ' => 'price ' ],
237
- // TODO: Skipped MC-33231
238
- //'default_order_custom_attribute_asc' => ['default_sort' => 'price'],
239
- //'default_order_custom_attribute_desc' => ['default_sort' => 'price'],
240
- ]
241
- );
257
+ return [
258
+ 'default_order_price_asc ' => [
259
+ 'sort ' => 'price ' ,
260
+ 'direction ' => 'asc ' ,
261
+ 'expectation ' => ['simple1 ' , 'simple2 ' , 'simple3 ' ],
262
+ 'default_sort ' => 'position '
263
+ ],
264
+ 'default_order_price_desc ' => [
265
+ 'sort ' => 'price ' ,
266
+ 'direction ' => 'desc ' ,
267
+ 'expectation ' => ['simple3 ' , 'simple2 ' , 'simple1 ' ],
268
+ 'default_sort ' => 'position '
269
+ ],
270
+ 'default_order_position_asc ' => [
271
+ 'sort ' => 'position ' ,
272
+ 'direction ' => 'asc ' ,
273
+ 'expectation ' => ['simple1 ' , 'simple2 ' , 'simple3 ' ],
274
+ 'default_sort ' => 'price '
275
+ ],
276
+ 'default_order_position_desc ' => [
277
+ 'sort ' => 'position ' ,
278
+ 'direction ' => 'desc ' ,
279
+ 'expectation ' => ['simple3 ' , 'simple2 ' , 'simple1 ' ],
280
+ 'default_sort ' => 'price '
281
+ ],
282
+ 'default_order_name_asc ' => [
283
+ 'sort ' => 'name ' ,
284
+ 'direction ' => 'asc ' ,
285
+ 'expectation ' => ['simple1 ' , 'simple2 ' , 'simple3 ' ],
286
+ 'default_sort ' => 'price '
287
+ ],
288
+ 'default_order_name_desc ' => [
289
+ 'sort ' => 'name ' ,
290
+ 'direction ' => 'desc ' ,
291
+ 'expectation ' => ['simple3 ' , 'simple2 ' , 'simple1 ' ],
292
+ 'default_sort ' => 'price '
293
+ ],
294
+ 'default_order_custom_attribute_asc ' => [
295
+ 'sort ' => 'test_configurable ' ,
296
+ 'direction ' => 'asc ' ,
297
+ 'expectation ' => ['simple1 ' , 'simple3 ' , 'simple2 ' ],
298
+ 'default_sort ' => 'price ' ,
299
+ 'incomplete_reason ' => 'MC-33825: '
300
+ . 'Stabilize skipped test cases for Integration SortingTest with elasticsearch ' ,
301
+ ],
302
+ 'default_order_custom_attribute_desc ' => [
303
+ 'sort ' => 'test_configurable ' ,
304
+ 'direction ' => 'desc ' ,
305
+ 'expectation ' => ['simple3 ' , 'simple2 ' , 'simple1 ' ],
306
+ 'default_sort ' => 'price ' ,
307
+ 'incomplete_reason ' => 'MC-33825: '
308
+ . 'Stabilize skipped test cases for Integration SortingTest with elasticsearch ' ,
309
+ ],
310
+ ];
242
311
}
243
312
244
313
/**
0 commit comments