@@ -205,6 +205,15 @@ public function testApplyCustomLayoutUpdate(array $expectedData): void
205
205
\Magento \Framework \DataObject::class,
206
206
['getPageLayout ' , 'getLayoutUpdates ' ]
207
207
);
208
+ $ this ->category ->expects ($ this ->at (1 ))
209
+ ->method ('hasChildren ' )
210
+ ->willReturn (true );
211
+ $ this ->category ->expects ($ this ->at (2 ))
212
+ ->method ('hasChildren ' )
213
+ ->willReturn ($ expectedData [1 ][0 ]['type ' ] === 'default ' ? true : false );
214
+ $ this ->category ->expects ($ this ->once ())
215
+ ->method ('getDisplayMode ' )
216
+ ->willReturn ($ expectedData [2 ][0 ]['displaymode ' ]);
208
217
$ this ->expectationForPageLayoutHandles ($ expectedData );
209
218
$ settings ->expects ($ this ->atLeastOnce ())->method ('getPageLayout ' )->will ($ this ->returnValue ($ pageLayout ));
210
219
$ settings ->expects ($ this ->once ())->method ('getLayoutUpdates ' )->willReturn (['update1 ' , 'update2 ' ]);
@@ -221,7 +230,8 @@ public function testApplyCustomLayoutUpdate(array $expectedData): void
221
230
*/
222
231
private function expectationForPageLayoutHandles ($ data ): void
223
232
{
224
- $ index = 2 ;
233
+ $ index = 1 ;
234
+
225
235
foreach ($ data as $ expectedData ) {
226
236
$ this ->page ->expects ($ this ->at ($ index ))
227
237
->method ('addPageLayoutHandles ' )
@@ -240,8 +250,23 @@ public function getInvocationData(): array
240
250
return [
241
251
[
242
252
'layoutHandles ' => [
253
+ [['type ' => 'default ' ], null , false ],
254
+ [['type ' => 'default_without_children ' ], null , false ],
255
+ [['displaymode ' => 'products ' ], null , false ]
256
+ ]
257
+ ],
258
+ [
259
+ 'layoutHandles ' => [
260
+ [['type ' => 'default ' ], null , false ],
243
261
[['type ' => 'default_without_children ' ], null , false ],
244
- [['displaymode ' => '' ], null , false ]
262
+ [['displaymode ' => 'page ' ], null , false ]
263
+ ]
264
+ ],
265
+ [
266
+ 'layoutHandles ' => [
267
+ [['type ' => 'default ' ], null , false ],
268
+ [['type ' => 'default ' ], null , false ],
269
+ [['displaymode ' => 'poducts_and_page ' ], null , false ]
245
270
]
246
271
]
247
272
];
0 commit comments