Skip to content

Commit

Permalink
Update tests for failed hook to work with phpunit 10
Browse files Browse the repository at this point in the history
  • Loading branch information
pprkut committed Sep 8, 2023
1 parent 2252a18 commit adb5842
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/Requests/RequestsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function testDefaultTransport() {
}

public function testTransportFailedTriggersRequestsFailedCallback() {
$mock = $this->getMockBuilder(stdClass::class)->setMethods(['failed'])->getMock();
$mock = $this->getMockedStdClassWithMethods(['failed']);
$mock->expects($this->once())->method('failed');
$hooks = new Hooks();
$hooks->register('requests.failed', [$mock, 'failed']);
Expand All @@ -175,7 +175,7 @@ public function testTransportFailedTriggersRequestsFailedCallback() {
}

public function testTransportInvalidArgumentTriggersRequestsFailedCallback() {
$mock = $this->getMockBuilder(stdClass::class)->setMethods(['failed'])->getMock();
$mock = $this->getMockedStdClassWithMethods(['failed']);
$mock->expects($this->once())->method('failed');
$hooks = new Hooks();
$hooks->register('requests.failed', [$mock, 'failed']);
Expand Down Expand Up @@ -299,7 +299,7 @@ public function testInvalidProtocolVersion() {
* new issue, and update your server/proxy to support a proper protocol.
*/
public function testInvalidProtocolVersionTriggersRequestsFailedCallback() {
$mock = $this->getMockBuilder(stdClass::class)->setMethods(['failed'])->getMock();
$mock = $this->getMockedStdClassWithMethods(['failed']);
$mock->expects($this->once())->method('failed');
$hooks = new Hooks();
$hooks->register('requests.failed', [$mock, 'failed']);
Expand Down Expand Up @@ -337,7 +337,7 @@ public function testSingleCRLFSeparator() {
* HTTP/0.9 also appears to use a single CRLF instead of two.
*/
public function testSingleCRLFSeparatorTriggersRequestsFailedCallback() {
$mock = $this->getMockBuilder(stdClass::class)->setMethods(['failed'])->getMock();
$mock = $this->getMockedStdClassWithMethods(['failed']);
$mock->expects($this->once())->method('failed');
$hooks = new Hooks();
$hooks->register('requests.failed', [$mock, 'failed']);
Expand Down Expand Up @@ -369,7 +369,7 @@ public function testInvalidStatus() {
}

public function testInvalidStatusTriggersRequestsFailedCallback() {
$mock = $this->getMockBuilder(stdClass::class)->setMethods(['failed'])->getMock();
$mock = $this->getMockedStdClassWithMethods(['failed']);
$mock->expects($this->once())->method('failed');
$hooks = new Hooks();
$hooks->register('requests.failed', [$mock, 'failed']);
Expand Down Expand Up @@ -400,7 +400,7 @@ public function test30xWithoutLocation() {
}

public function testRedirectToExceptionTriggersRequestsFailedCallbackOnce() {
$mock = $this->getMockBuilder(stdClass::class)->setMethods(['failed'])->getMock();
$mock = $this->getMockedStdClassWithMethods(['failed']);
$mock->expects($this->once())->method('failed');
$hooks = new Hooks();
$hooks->register('requests.failed', [$mock, 'failed']);
Expand All @@ -423,7 +423,7 @@ public function testRedirectToExceptionTriggersRequestsFailedCallbackOnce() {
}

public function testRedirectToInvalidArgumentTriggersRequestsFailedCallbackOnce() {
$mock = $this->getMockBuilder(stdClass::class)->setMethods(['failed'])->getMock();
$mock = $this->getMockedStdClassWithMethods(['failed']);
$mock->expects($this->once())->method('failed');
$hooks = new Hooks();
$hooks->register('requests.failed', [$mock, 'failed']);
Expand Down

0 comments on commit adb5842

Please sign in to comment.