From 1e08f54b0823a2fa9747387986276ac58f7db571 Mon Sep 17 00:00:00 2001
From: diosmosis <benaka.moorthi@gmail.com>
Date: Sat, 9 Mar 2013 23:54:49 +0000
Subject: [PATCH] fixing build, another attempt

---
 plugins/UserCountry/LocationProvider.php                 | 1 +
 tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/plugins/UserCountry/LocationProvider.php b/plugins/UserCountry/LocationProvider.php
index a364615338..3f6b8821ed 100755
--- a/plugins/UserCountry/LocationProvider.php
+++ b/plugins/UserCountry/LocationProvider.php
@@ -300,6 +300,7 @@ abstract class Piwik_UserCountry_LocationProvider
 				"Invalid provider ID '$providerId'. The provider either does not exist or is not available");
 		}
 		Piwik_SetOption(self::CURRENT_PROVIDER_OPTION_NAME, $providerId);
+		Piwik_Tracker_Cache::clearCacheGeneral();
 		return $provider;
 	}
 	
diff --git a/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php b/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php
index 2ab755e75f..9185998624 100755
--- a/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php
+++ b/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php
@@ -203,6 +203,11 @@ class Test_Piwik_Integration_ManyVisitorsOneWebsiteTest extends IntegrationTestC
 		Piwik_UserCountry_LocationProvider::$providers = null;
 		Piwik_UserCountry_LocationProvider::setCurrentProvider(self::GEOIP_IMPL_TO_TEST);
 		
+		if (Piwik_UserCountry_LocationProvider::getCurrentProviderId() !== self::GEOIP_IMPL_TO_TEST)
+		{
+			throw new Exception("Failed to set the current location provider to '".self::GEOIP_IMPL_TO_TEST."'.");
+		}
+		
 		$possibleFiles = Piwik_UserCountry_LocationProvider_GeoIp::$dbNames['loc'];
 		if (Piwik_UserCountry_LocationProvider_GeoIp::getPathToGeoIpDatabase($possibleFiles) === false)
 		{
-- 
GitLab