|
@@ 40-51 (lines=12) @@
|
| 37 |
|
$this->assertEquals([], $candidates); |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
public function testGetCandidatesEmptyAsync(): void |
| 41 |
|
{ |
| 42 |
|
$httpClient = $this->getMockBuilder(HttpClient::class)->getMock(); |
| 43 |
|
$strategy = new ConfiguredClientsStrategy($httpClient, null); |
| 44 |
|
|
| 45 |
|
$candidates = $strategy::getCandidates(HttpClient::class); |
| 46 |
|
$candidate = array_shift($candidates); |
| 47 |
|
$this->assertEquals($httpClient, $candidate['class']()); |
| 48 |
|
|
| 49 |
|
$candidates = $strategy::getCandidates(HttpAsyncClient::class); |
| 50 |
|
$this->assertEquals([], $candidates); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function testGetCandidatesEmptySync(): void |
| 54 |
|
{ |
|
@@ 53-64 (lines=12) @@
|
| 50 |
|
$this->assertEquals([], $candidates); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function testGetCandidatesEmptySync(): void |
| 54 |
|
{ |
| 55 |
|
$httpAsyncClient = $this->getMockBuilder(HttpAsyncClient::class)->getMock(); |
| 56 |
|
$strategy = new ConfiguredClientsStrategy(null, $httpAsyncClient); |
| 57 |
|
|
| 58 |
|
$candidates = $strategy::getCandidates(HttpClient::class); |
| 59 |
|
$this->assertEquals([], $candidates); |
| 60 |
|
|
| 61 |
|
$candidates = $strategy::getCandidates(HttpAsyncClient::class); |
| 62 |
|
$candidate = array_shift($candidates); |
| 63 |
|
$this->assertEquals($httpAsyncClient, $candidate['class']()); |
| 64 |
|
} |
| 65 |
|
} |
| 66 |
|
|