private function setLocationProvider($file)
{
GeoIp::$dbNames['loc'] = array($file);
GeoIp::$geoIPDatabaseDir = 'tests/lib/geoip-files';
LocationProvider::$providers = null;
LocationProvider::setCurrentProvider(self::GEOIP_IMPL_TO_TEST);
if (LocationProvider::getCurrentProviderId() !== self::GEOIP_IMPL_TO_TEST) {
throw new Exception("Failed to set the current location provider to '" . self::GEOIP_IMPL_TO_TEST . "'.");
}
$possibleFiles = GeoIp::$dbNames['loc'];
if (GeoIp::getPathToGeoIpDatabase($possibleFiles) === false) {
throw new Exception("The GeoIP location provider cannot find the '{$file}' file! Tests will fail.");
}
}