Skip to content
Extraits de code Groupes Projets
Valider 36698f27 rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Merge branch 'master' into uiunittests

parents 029872ed d90f41b8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -68,30 +68,45 @@ class Manager extends Singleton ...@@ -68,30 +68,45 @@ class Manager extends Singleton
'ExampleUI', 'ExampleUI',
'ExampleVisualization', 'ExampleVisualization',
'ExamplePluginTemplate', 'ExamplePluginTemplate',
);
protected $coreThemesDisabledByDefault = array(
'ExampleTheme', 'ExampleTheme',
'LeftMenu' 'LeftMenu',
'Zeitgeist',
); );
public function getPluginsToLoadDuringTests() public function getPluginsToLoadDuringTests()
{ {
$toLoad = array(); $toLoad = array();
foreach($this->readPluginsDirectory() as $plugin) { foreach($this->readPluginsDirectory() as $plugin) {
// Load all default plugins
$isPluginBundledWithCore = $this->isPluginBundledWithCore($plugin); $isPluginBundledWithCore = $this->isPluginBundledWithCore($plugin);
// Load plugins from submodules
$isPluginOfficiallySupported = $this->isPluginOfficialAndNotBundledWithCore($plugin); $isPluginOfficiallySupported = $this->isPluginOfficialAndNotBundledWithCore($plugin);
// Do not enable other Login plugins // Do not enable other Login plugins
$isPluginOfficiallySupported = $isPluginOfficiallySupported && strpos($plugin, 'Login') === false; $isPluginOfficiallySupported = $isPluginOfficiallySupported && strpos($plugin, 'Login') === false;
if($isPluginBundledWithCore || $isPluginOfficiallySupported) { $loadPlugin = $isPluginBundledWithCore || $isPluginOfficiallySupported;
// Do not enable other Themes
$isThemeDisabled = in_array($plugin, $this->coreThemesDisabledByDefault);
$loadPlugin = $loadPlugin && !$isThemeDisabled;
if($loadPlugin) {
$toLoad[] = $plugin; $toLoad[] = $plugin;
} }
} }
return $toLoad; return $toLoad;
} }
public function getCorePluginsDisabledByDefault() public function getCorePluginsDisabledByDefault()
{ {
return $this->corePluginsDisabledByDefault; return array_merge( $this->corePluginsDisabledByDefault, $this->coreThemesDisabledByDefault);
} }
// If a plugin hooks onto at least an event starting with "Tracker.", we load the plugin during tracker // If a plugin hooks onto at least an event starting with "Tracker.", we load the plugin during tracker
...@@ -384,10 +399,11 @@ class Manager extends Singleton ...@@ -384,10 +399,11 @@ class Manager extends Singleton
{ {
$plugins = $this->getLoadedPlugins(); $plugins = $this->getLoadedPlugins();
foreach ($plugins as $plugin) foreach ($plugins as $plugin) {
if ($plugin->isTheme() && $plugin->getPluginName() == $themeName) if ($plugin->isTheme() && $plugin->getPluginName() == $themeName) {
return new Theme($plugin); return new Theme($plugin);
}
}
throw new \Exception('Theme not found : ' . $themeName); throw new \Exception('Theme not found : ' . $themeName);
} }
......
...@@ -55,7 +55,7 @@ class MultiSites extends \Piwik\Plugin ...@@ -55,7 +55,7 @@ class MultiSites extends \Piwik\Plugin
'metrics' => $metadataMetrics, 'metrics' => $metadataMetrics,
'processedMetrics' => false, 'processedMetrics' => false,
'constantRowsCount' => false, 'constantRowsCount' => false,
'order' => 5 'order' => 4
); );
$reports[] = array( $reports[] = array(
......
...@@ -194,7 +194,7 @@ class ReleaseCheckListTest extends PHPUnit_Framework_TestCase ...@@ -194,7 +194,7 @@ class ReleaseCheckListTest extends PHPUnit_Framework_TestCase
$disabled = in_array($pluginName, $manager->getCorePluginsDisabledByDefault()); $disabled = in_array($pluginName, $manager->getCorePluginsDisabledByDefault());
$isGitSubmodule = Manager::getInstance()->isPluginOfficialAndNotBundledWithCore($pluginName); $isGitSubmodule = Manager::getInstance()->isPluginOfficialAndNotBundledWithCore($pluginName);
$enabled = in_array($pluginName, $pluginsBundledWithPiwik) || $isGitSubmodule || $pluginName == $manager::DEFAULT_THEME; $enabled = in_array($pluginName, $pluginsBundledWithPiwik) || $isGitSubmodule;
$this->assertTrue( $enabled + $disabled === 1, $this->assertTrue( $enabled + $disabled === 1,
"Plugin $pluginName should be either enabled (in global.ini.php) or disabled (in Piwik\\Plugin\\Manager)." "Plugin $pluginName should be either enabled (in global.ini.php) or disabled (in Piwik\\Plugin\\Manager)."
......
...@@ -41,7 +41,7 @@ class Test_Piwik_Fixture_OmniFixture extends Fixture ...@@ -41,7 +41,7 @@ class Test_Piwik_Fixture_OmniFixture extends Fixture
$fixture = new $className(); $fixture = new $className();
if (!property_exists($fixture, 'dateTime')) { if (!property_exists($fixture, 'dateTime')) {
continue; continue;
} }
$fixture->dateTime = $this->adjustDateTime($fixture->dateTime, $date); $fixture->dateTime = $this->adjustDateTime($fixture->dateTime, $date);
......
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