@@ -139,9 +139,10 @@ public function testUrlSetOnException()
139
139
/** @var \Magento\CatalogSearch\Controller\Advanced\Result $instance */
140
140
$ instance = $ objectManager ->getObject (
141
141
\Magento \CatalogSearch \Controller \Advanced \Result::class,
142
- ['context ' => $ contextMock ,
143
- 'catalogSearchAdvanced ' => $ catalogSearchAdvanced ,
144
- 'urlFactory ' => $ urlFactoryMock
142
+ [
143
+ 'context ' => $ contextMock ,
144
+ 'catalogSearchAdvanced ' => $ catalogSearchAdvanced ,
145
+ 'urlFactory ' => $ urlFactoryMock
145
146
]
146
147
);
147
148
$ this ->assertEquals ($ redirectResultMock , $ instance ->execute ());
@@ -151,10 +152,25 @@ public function testNoResultsHandle()
151
152
{
152
153
$ expectedQuery = 'notExistTerm ' ;
153
154
154
- $ view = $ this ->createPartialMock (\Magento \Framework \App \View::class, ['loadLayout ' , 'renderLayout ' ]);
155
+ $ update = $ this ->createPartialMock (\Magento \Framework \View \Model \Layout \Merge::class, ['getHandles ' ]);
156
+ $ update ->expects ($ this ->once ())->method ('getHandles ' )->will ($ this ->returnValue ([]));
157
+
158
+ $ layout = $ this ->createPartialMock (\Magento \Framework \View \Result \Layout::class, ['getUpdate ' ]);
159
+ $ layout ->expects ($ this ->once ())->method ('getUpdate ' )->will ($ this ->returnValue ($ update ));
160
+
161
+ $ page = $ this ->createPartialMock (\Magento \Framework \View \Result \Page::class, ['initLayout ' ]);
162
+
163
+ $ view = $ this ->createPartialMock (
164
+ \Magento \Framework \App \View::class,
165
+ ['loadLayout ' , 'renderLayout ' , 'getPage ' , 'getLayout ' ]
166
+ );
167
+
155
168
$ view ->expects ($ this ->once ())->method ('loadLayout ' )
156
169
->with ([\Magento \CatalogSearch \Controller \Advanced \Result::DEFAULT_NO_RESULT_HANDLE ]);
157
170
171
+ $ view ->expects ($ this ->once ())->method ('getPage ' )->will ($ this ->returnValue ($ page ));
172
+ $ view ->expects ($ this ->once ())->method ('getLayout ' )->will ($ this ->returnValue ($ layout ));
173
+
158
174
$ request = $ this ->createPartialMock (\Magento \Framework \App \Console \Request::class, ['getQueryValue ' ]);
159
175
$ request ->expects ($ this ->once ())->method ('getQueryValue ' )->will ($ this ->returnValue ($ expectedQuery ));
160
176
0 commit comments