@@ -157,7 +157,7 @@ public function testDefaultTransport() {
157
157
}
158
158
159
159
public function testTransportFailedTriggersRequestsFailedCallback () {
160
- $ mock = $ this ->getMockBuilder (stdClass::class)-> setMethods ( ['failed ' ])-> getMock ( );
160
+ $ mock = $ this ->getMockedStdClassWithMethods ( ['failed ' ]);
161
161
$ mock ->expects ($ this ->once ())->method ('failed ' );
162
162
$ hooks = new Hooks ();
163
163
$ hooks ->register ('requests.failed ' , [$ mock , 'failed ' ]);
@@ -175,7 +175,7 @@ public function testTransportFailedTriggersRequestsFailedCallback() {
175
175
}
176
176
177
177
public function testTransportInvalidArgumentTriggersRequestsFailedCallback () {
178
- $ mock = $ this ->getMockBuilder (stdClass::class)-> setMethods ( ['failed ' ])-> getMock ( );
178
+ $ mock = $ this ->getMockedStdClassWithMethods ( ['failed ' ]);
179
179
$ mock ->expects ($ this ->once ())->method ('failed ' );
180
180
$ hooks = new Hooks ();
181
181
$ hooks ->register ('requests.failed ' , [$ mock , 'failed ' ]);
@@ -299,7 +299,7 @@ public function testInvalidProtocolVersion() {
299
299
* new issue, and update your server/proxy to support a proper protocol.
300
300
*/
301
301
public function testInvalidProtocolVersionTriggersRequestsFailedCallback () {
302
- $ mock = $ this ->getMockBuilder (stdClass::class)-> setMethods ( ['failed ' ])-> getMock ( );
302
+ $ mock = $ this ->getMockedStdClassWithMethods ( ['failed ' ]);
303
303
$ mock ->expects ($ this ->once ())->method ('failed ' );
304
304
$ hooks = new Hooks ();
305
305
$ hooks ->register ('requests.failed ' , [$ mock , 'failed ' ]);
@@ -337,7 +337,7 @@ public function testSingleCRLFSeparator() {
337
337
* HTTP/0.9 also appears to use a single CRLF instead of two.
338
338
*/
339
339
public function testSingleCRLFSeparatorTriggersRequestsFailedCallback () {
340
- $ mock = $ this ->getMockBuilder (stdClass::class)-> setMethods ( ['failed ' ])-> getMock ( );
340
+ $ mock = $ this ->getMockedStdClassWithMethods ( ['failed ' ]);
341
341
$ mock ->expects ($ this ->once ())->method ('failed ' );
342
342
$ hooks = new Hooks ();
343
343
$ hooks ->register ('requests.failed ' , [$ mock , 'failed ' ]);
@@ -369,7 +369,7 @@ public function testInvalidStatus() {
369
369
}
370
370
371
371
public function testInvalidStatusTriggersRequestsFailedCallback () {
372
- $ mock = $ this ->getMockBuilder (stdClass::class)-> setMethods ( ['failed ' ])-> getMock ( );
372
+ $ mock = $ this ->getMockedStdClassWithMethods ( ['failed ' ]);
373
373
$ mock ->expects ($ this ->once ())->method ('failed ' );
374
374
$ hooks = new Hooks ();
375
375
$ hooks ->register ('requests.failed ' , [$ mock , 'failed ' ]);
@@ -400,7 +400,7 @@ public function test30xWithoutLocation() {
400
400
}
401
401
402
402
public function testRedirectToExceptionTriggersRequestsFailedCallbackOnce () {
403
- $ mock = $ this ->getMockBuilder (stdClass::class)-> setMethods ( ['failed ' ])-> getMock ( );
403
+ $ mock = $ this ->getMockedStdClassWithMethods ( ['failed ' ]);
404
404
$ mock ->expects ($ this ->once ())->method ('failed ' );
405
405
$ hooks = new Hooks ();
406
406
$ hooks ->register ('requests.failed ' , [$ mock , 'failed ' ]);
@@ -423,7 +423,7 @@ public function testRedirectToExceptionTriggersRequestsFailedCallbackOnce() {
423
423
}
424
424
425
425
public function testRedirectToInvalidArgumentTriggersRequestsFailedCallbackOnce () {
426
- $ mock = $ this ->getMockBuilder (stdClass::class)-> setMethods ( ['failed ' ])-> getMock ( );
426
+ $ mock = $ this ->getMockedStdClassWithMethods ( ['failed ' ]);
427
427
$ mock ->expects ($ this ->once ())->method ('failed ' );
428
428
$ hooks = new Hooks ();
429
429
$ hooks ->register ('requests.failed ' , [$ mock , 'failed ' ]);
0 commit comments