Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/PHPUnit/IntegrationTestCase.php')
-rwxr-xr-xtests/PHPUnit/IntegrationTestCase.php26
1 files changed, 17 insertions, 9 deletions
diff --git a/tests/PHPUnit/IntegrationTestCase.php b/tests/PHPUnit/IntegrationTestCase.php
index 941828d6a7..e7958db543 100755
--- a/tests/PHPUnit/IntegrationTestCase.php
+++ b/tests/PHPUnit/IntegrationTestCase.php
@@ -54,6 +54,22 @@ abstract class IntegrationTestCase extends PHPUnit_Framework_TestCase
}
}
+ /**
+ * @param $createEmptyDatabase
+ */
+ protected static function installAndLoadPlugins($installPlugins)
+ {
+ $pluginsManager = Piwik_PluginsManager::getInstance();
+ $plugins = $pluginsManager->readPluginsDirectory();
+
+ $pluginsManager->loadPlugins($plugins);
+ if ($installPlugins)
+ {
+ $pluginsManager->installLoadedPlugins();
+ }
+ }
+
+
public static function loadAllPlugins()
{
$pluginsManager = Piwik_PluginsManager::getInstance();
@@ -143,16 +159,8 @@ abstract class IntegrationTestCase extends PHPUnit_Framework_TestCase
// We need to be SU to create websites for tests
Piwik::setUserIsSuperUser();
Piwik_Tracker_Cache::deleteTrackerCache();
+ self::installAndLoadPlugins( $installPlugins = $createEmptyDatabase);
- // Load and install plugins
- $pluginsManager = Piwik_PluginsManager::getInstance();
- $plugins = $pluginsManager->readPluginsDirectory();
-
- $pluginsManager->loadPlugins($plugins);
- if ($createEmptyDatabase) // only install if database is empty
- {
- $pluginsManager->installLoadedPlugins();
- }
$_GET = $_REQUEST = array();
$_SERVER['HTTP_REFERER'] = '';