@@ -100,8 +100,11 @@ public function prepareMocksForTestExecute()
100
100
->willReturn (true );
101
101
$ this ->request ->expects ($ this ->at (0 ))
102
102
->method ('getParam ' )
103
- ->with ('items ' , [])
104
- ->willReturn ($ postData );
103
+ ->willReturnMap (
104
+ [
105
+ ['items ' , [], $ postData ]
106
+ ]
107
+ );
105
108
$ this ->pageRepository ->expects ($ this ->once ())
106
109
->method ('getById ' )
107
110
->with (1 )
@@ -164,7 +167,7 @@ public function testExecuteWithLocalizedException()
164
167
])
165
168
->willReturnSelf ();
166
169
167
- $ this ->controller ->execute ();
170
+ $ this ->assertSame ( $ this -> resultJson , $ this -> controller ->execute () );
168
171
}
169
172
170
173
public function testExecuteWithRuntimeException ()
@@ -185,7 +188,7 @@ public function testExecuteWithRuntimeException()
185
188
])
186
189
->willReturnSelf ();
187
190
188
- $ this ->controller ->execute ();
191
+ $ this ->assertSame ( $ this -> resultJson , $ this -> controller ->execute () );
189
192
}
190
193
191
194
public function testExecuteWithException ()
@@ -206,7 +209,7 @@ public function testExecuteWithException()
206
209
])
207
210
->willReturnSelf ();
208
211
209
- $ this ->controller ->execute ();
212
+ $ this ->assertSame ( $ this -> resultJson , $ this -> controller ->execute () );
210
213
}
211
214
212
215
public function testExecuteWithoutData ()
@@ -220,8 +223,11 @@ public function testExecuteWithoutData()
220
223
->willReturn ([]);
221
224
$ this ->request ->expects ($ this ->at (1 ))
222
225
->method ('getParam ' )
223
- ->with ('isAjax ' , null )
224
- ->willReturn (true );
226
+ ->willReturnMap (
227
+ [
228
+ ['isAjax ' , null , true ]
229
+ ]
230
+ );
225
231
$ this ->resultJson ->expects ($ this ->once ())
226
232
->method ('setData ' )
227
233
->with ([
@@ -232,7 +238,7 @@ public function testExecuteWithoutData()
232
238
])
233
239
->willReturnSelf ();
234
240
235
- $ this ->controller ->execute ();
241
+ $ this ->assertSame ( $ this -> resultJson , $ this -> controller ->execute () );
236
242
}
237
243
238
244
public function testSetCmsPageData ()
0 commit comments