Skip to content
Extraits de code Groupes Projets
Valider f59fbe49 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

refs #5940 this might fix the integration tests. Took me a long time to figure...

refs #5940 this might fix the integration tests. Took me a long time to figure out what is going on. We should reset all the caches at least before each class otherwise the tests are no longer atomic and therefore worthless. This test was working when executing only this test but not when executing all tests
parent b9112763
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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
......
......@@ -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();
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter