diff --git a/core/Cache/StaticCache.php b/core/Cache/StaticCache.php index b09f49ae0b0972cbcda27de10035b8da4ced6067..0c102e18d39143312dd3c56150d5af8827b47f7e 100644 --- a/core/Cache/StaticCache.php +++ b/core/Cache/StaticCache.php @@ -69,6 +69,15 @@ class StaticCache unset(self::$staticCache[$this->cacheKey]); } + /** + * Reset the stored content of the current cache key. + * @ignore + */ + public static function clearAll() + { + self::$staticCache = array(); + } + /** * Set (overwrite) any content related to the current set cache key. * @param $content diff --git a/plugins/Insights/tests/Integration/ApiTest.php b/plugins/Insights/tests/Integration/ApiTest.php index 292ba3e85a0a0f1a3d62aef97139ab80648c257a..f9318903cd7cd2bbec7a5edc361d32eaf2405e2e 100644 --- a/plugins/Insights/tests/Integration/ApiTest.php +++ b/plugins/Insights/tests/Integration/ApiTest.php @@ -8,11 +8,14 @@ namespace Piwik\Plugins\Insights\tests; use Piwik\API\Request as ApiRequest; +use Piwik\Cache\PluginAwareStaticCache; +use Piwik\Cache\StaticCache; use Piwik\DataTable; use Piwik\DataTable\Row; use Piwik\Plugins\Insights\API; use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays; -use Piwik\Tests\Impl\SystemTestCase; +use Piwik\Tests\Impl\IntegrationTestCase; +use Piwik\Tracker\Cache; use Piwik\Translate; /** @@ -21,7 +24,7 @@ use Piwik\Translate; * @group Plugins * @group Plugins */ -class ApiTest extends SystemTestCase +class ApiTest extends IntegrationTestCase { /** * @var SomeVisitsDifferentPathsOnTwoDays @@ -38,6 +41,9 @@ class ApiTest extends SystemTestCase { parent::setUp(); + StaticCache::clearAll(); + PluginAwareStaticCache::clearAll(); + Translate::reloadLanguage('en'); $this->api = API::getInstance(); }