Skip to content

Commit e2d8860

Browse files
authored
Do not force to have a client installed (#10)
* Do not force to have a client installed * Update what packages to require
1 parent 64dd383 commit e2d8860

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"php": "^7.0",
2121
"phpunit/phpunit": "^6.1",
2222
"psr/http-message-implementation": "^1.0",
23-
"willdurand/geocoder": "^4.0",
23+
"geocoder-php/google-maps-provider": "^4.0",
2424
"php-http/mock-client": "^1.0",
2525
"nyholm/psr7": "^0.2.2"
2626
},

src/ProviderIntegrationTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,16 @@ private function getHttpClient(ResponseInterface $response)
9090
*/
9191
private function getCachedHttpClient()
9292
{
93-
$client = HttpClientDiscovery::find();
93+
try {
94+
$client = HttpClientDiscovery::find();
95+
} catch (\Http\Discovery\NotFoundException $e) {
96+
$client = $this->getMockForAbstractClass(HttpClient::class);
97+
98+
$client
99+
->expects($this->any())
100+
->method('sendRequest')
101+
->willThrowException($e);
102+
}
94103

95104
return new CachedResponseClient($client, $this->getCacheDir(), $this->getApiKey());
96105
}

0 commit comments

Comments
 (0)