geocoder-php /
ip2location-binary-provider
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | /* |
||
| 6 | * This file is part of the Geocoder package. |
||
| 7 | * For the full copyright and license information, please view the LICENSE |
||
| 8 | * file that was distributed with this source code. |
||
| 9 | * |
||
| 10 | * @license MIT License |
||
| 11 | */ |
||
| 12 | |||
| 13 | namespace Geocoder\Provider\IP2LocationBinary\Tests; |
||
| 14 | |||
| 15 | use Geocoder\IntegrationTest\ProviderIntegrationTest; |
||
| 16 | use Geocoder\Provider\IP2LocationBinary\IP2LocationBinary; |
||
| 17 | use Http\Client\HttpClient; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @author IP2Location <[email protected]> |
||
| 21 | */ |
||
| 22 | class IntegrationTest extends ProviderIntegrationTest |
||
| 23 | { |
||
| 24 | protected $skippedTests = [ |
||
| 25 | ]; |
||
| 26 | |||
| 27 | protected $testAddress = false; |
||
| 28 | |||
| 29 | protected $testReverse = false; |
||
| 30 | |||
| 31 | protected $testIpv6 = false; |
||
| 32 | |||
| 33 | protected $testHttpProvider = false; |
||
| 34 | |||
| 35 | public static function setUpBeforeClass(): void |
||
| 36 | { |
||
| 37 | if (false == class_exists('\\IP2Location\\Database')) { |
||
|
0 ignored issues
–
show
|
|||
| 38 | self::markTestSkipped('The IP2Location\'s official library required to run these tests.'); |
||
| 39 | } |
||
| 40 | |||
| 41 | parent::setUpBeforeClass(); |
||
| 42 | } |
||
| 43 | |||
| 44 | protected function createProvider(HttpClient $httpClient) |
||
| 45 | { |
||
| 46 | // Download this BIN database from https://lite.ip2location.com/database/ip-country-region-city-latitude-longitude-zipcode |
||
| 47 | return new IP2LocationBinary(__DIR__.'/fixtures/IP2LOCATION-LITE-DB9.IPV6.BIN', \IP2Location\Database::FILE_IO); |
||
| 48 | } |
||
| 49 | |||
| 50 | protected function getCacheDir() |
||
| 51 | { |
||
| 52 | return __DIR__.'/.cached_responses'; |
||
| 53 | } |
||
| 54 | |||
| 55 | protected function getApiKey() |
||
| 56 | { |
||
| 57 | return null; |
||
| 58 | } |
||
| 59 | } |
||
| 60 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.