diff --git a/tests/Http/HttpClientTest.php b/tests/Http/HttpClientTest.php index a8bb5e0e5825..55bc72814353 100644 --- a/tests/Http/HttpClientTest.php +++ b/tests/Http/HttpClientTest.php @@ -36,6 +36,11 @@ protected function setUp(): void $this->factory = new Factory; } + protected function tearDown(): void + { + m::close(); + } + public function testStubbedResponsesAreReturnedAfterFaking() { $this->factory->fake(); @@ -936,8 +941,6 @@ public function testTheRequestSendingAndResponseReceivedEventsAreFiredWhenAReque $factory->post('https://example.com'); $factory->patch('https://example.com'); $factory->delete('https://example.com'); - - m::close(); } public function testTheRequestSendingAndResponseReceivedEventsAreFiredWhenARequestIsSentAsync() @@ -957,8 +960,6 @@ public function testTheRequestSendingAndResponseReceivedEventsAreFiredWhenAReque $pool->delete('https://example.com'), ]; }); - - m::close(); } public function testTheTransferStatsAreCalledSafelyWhenFakingTheRequest() @@ -988,13 +989,12 @@ public function testClonedClientsWorkSuccessfullyWithTheRequestObject() $events->shouldReceive('dispatch')->once()->with(m::type(ResponseReceived::class)); $factory = new Factory($events); + $factory->fake(['example.com' => $factory->response('foo', 200)]); $client = $factory->timeout(10); $clonedClient = clone $client; $clonedClient->get('https://example.com'); - - m::close(); } public function testRequestIsMacroable()