https://github.com/geocoder-php/provider-integration-tests
Integration tests for Providers
https://github.com/geocoder-php/provider-integration-tests
Last synced: 23 days ago
JSON representation
Integration tests for Providers
- Host: GitHub
- URL: https://github.com/geocoder-php/provider-integration-tests
- Owner: geocoder-php
- License: mit
- Created: 2017-05-15T13:10:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-11-23T09:34:02.000Z (3 months ago)
- Last Synced: 2025-11-23T11:20:19.634Z (3 months ago)
- Language: PHP
- Size: 45.9 KB
- Stars: 0
- Watchers: 5
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Geocoder integration tests
[](https://github.com/geocoder-php/provider-integration-tests/actions/workflows/php.yml)
[](https://packagist.org/packages/geocoder-php/provider-integration-tests)
[](https://packagist.org/packages/geocoder-php/provider-integration-tests)
[](https://packagist.org/packages/geocoder-php/provider-integration-tests)
[](LICENSE)
This repository contains integration tests to make sure your implementation of a Geocoder Provider is correct.
### Install
```bash
composer require --dev geocoder-php/provider-integration-tests:dev-master
```
### Use
Create a test that looks like this:
```php
use Geocoder\IntegrationTest\ProviderIntegrationTest;
use Geocoder\Provider\GoogleMaps\GoogleMaps;
use Psr\Http\Client\ClientInterface;
class IntegrationTest extends ProviderIntegrationTest
{
protected function createProvider(ClientInterface $httpClient)
{
return new GoogleMaps($httpClient);
}
protected function getCacheDir(): string;
{
return dirname(__DIR__).'/.cached_responses';
}
protected function getApiKey(): string;
{
return env('GOOGLE_API_KEY');
}
}
```