Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Illuminate/Http/Client/PendingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ public function delete(string $url, $data = [])
* @param int|null $concurrency
* @return array<array-key, \Illuminate\Http\Client\Response|\Illuminate\Http\Client\ConnectionException|\Illuminate\Http\Client\RequestException>
*/
public function pool(callable $callback, ?int $concurrency = null)
public function pool(callable $callback, ?int $concurrency = 0)
{
$results = [];

Expand Down
8 changes: 4 additions & 4 deletions tests/Http/HttpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3527,14 +3527,14 @@ public function testItCanEnforceFakingInThePool()
$this->assertSame(200, $responses[0]->status());
$this->assertSame(200, $responses[1]->status());

$this->expectException(StrayRequestException::class);
$this->expectExceptionMessage('Attempted request to [https://laravel.com] without a matching fake.');

$this->factory->pool(function (Pool $pool) {
[$exception] = $this->factory->pool(function (Pool $pool) {
return [
$pool->get('https://laravel.com'),
];
});

$this->assertInstanceOf(StrayRequestException::class, $exception);
$this->assertEquals('Attempted request to [https://laravel.com] without a matching fake.', $exception->getMessage());
Comment on lines +3530 to +3537
Copy link
Contributor Author

@cosmastech cosmastech Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified this test to match how we are testing other pooled exceptions in this file. The exception was being thrown because the pool was running in series rather than actually as a pool. This behavior better lines up with how it should be used (in my opinion).

}

public function testPreventingStrayRequests()
Expand Down
Loading