geocoder-php / provider-integration-tests
Geocoder 提供者集成测试
1.6.4
2024-03-02 12:18 UTC
Requires
- php: ^7.3 || ^8.0
- nyholm/psr7: ^1.0
- php-http/curl-client: ^2.2
- php-http/mock-client: ^1.2
- phpunit/phpunit: ^9.5
- psr/http-client: ^1.0
Requires (Dev)
- geocoder-php/nominatim-provider: ^5.3
- phpstan/phpstan: ^1.10
README
该仓库包含集成测试,以确保您的 Geocoder 提供者实现正确。
安装
composer require --dev geocoder-php/provider-integration-tests:dev-master
使用
创建一个类似以下的测试
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'); } }