update v 1.0.7.5
This commit is contained in:
37
vendor/torann/geoip/tests/GeoIPUpdaterTest.php
vendored
Normal file
37
vendor/torann/geoip/tests/GeoIPUpdaterTest.php
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php namespace Torann\GeoIP\tests;
|
||||
|
||||
use Illuminate\Config\Repository;
|
||||
use \Torann\GeoIP\GeoIPUpdater;
|
||||
use PHPUnit_Framework_TestCase;
|
||||
|
||||
class GeoIPUpdaterTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
public function test_no_update()
|
||||
{
|
||||
$geoIPUpdater = new GeoIPUpdater(new Repository());
|
||||
$this->assertFalse($geoIPUpdater->update());
|
||||
}
|
||||
|
||||
public function test_max_mind_updater()
|
||||
{
|
||||
$database = __DIR__ . '/data/GeoLite2-City.mmdb';
|
||||
$config = new Repository([
|
||||
'geoip' => [
|
||||
'service' => 'maxmind',
|
||||
'maxmind' => [
|
||||
'type' => 'database',
|
||||
'database_path' => $database,
|
||||
'update_url' => 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz',
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$geoIPUpdater = new GeoIPUpdater($config);
|
||||
$this->assertEquals($geoIPUpdater->update(), $database);
|
||||
unlink($database);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user