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);
 }
Exemplo n.º 2
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $result = $this->geoIPUpdater->update();
     if (!$result) {
         $this->error('Update failed!');
         return;
     }
     $this->info('New update file (' . $result . ') installed.');
 }