Skip to content

Commit

Permalink
Revert change to not hardcode any plugin list (as nobody would rememb…
Browse files Browse the repository at this point in the history
…er to update those when we add plugins)
  • Loading branch information
mattab committed Feb 20, 2014
1 parent 85762b8 commit 9742718
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 56 deletions.
65 changes: 11 additions & 54 deletions core/Plugin/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,60 +72,17 @@ class Manager extends Singleton
'LeftMenu'
);

public static $pluginsToLoadForTests = array(
"CorePluginsAdmin",
"CoreAdminHome",
"CoreHome",
"Proxy",
"API",
"Widgetize",
"Transitions",
"LanguagesManager",
"Actions",
"Dashboard",
"MultiSites",
"Referrers",
"UserSettings",
"Goals",
"SEO",
"UserCountry",
"VisitsSummary",
"VisitFrequency",
"VisitTime",
"VisitorInterest",
"ExampleAPI",
"ExamplePlugin",
"ExampleRssWidget",
"Provider",
"Feedback",
"Login",
"UsersManager",
"SitesManager",
"Installation",
"CoreUpdater",
"ScheduledReports",
"UserCountryMap",
"Live",
"CustomVariables",
"PrivacyManager",
"ImageGraph",
"Annotations",
"MobileMessaging",
"Overlay",
"SegmentEditor",
"DevicesDetection",
"DBStats",
'ExampleUI',
"TasksTimetable",
"Morpheus",
"Zeitgeist",
"CustomAlerts",
"VisitorGenerator",
"SecurityInfo",
"ExampleSettingsPlugin",
"TreemapVisualization",
"Events"
);
public static function getPluginsToLoadDuringTests()
{
$manager = \Piwik\Plugin\Manager::getInstance();
$toLoad = array();
foreach($manager->readPluginsDirectory() as $plugin) {
if($manager->isPluginBundledWithCore($plugin)) {
$toLoad[] = $plugin;
}
}
return $toLoad;
}

public function getCorePluginsDisabledByDefault()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPUnit/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public static function _tearDownAfterClass($dropDatabase = true)

protected static function getPluginsToLoadDuringTests()
{
return \Piwik\Plugin\Manager::$pluginsToLoadForTests;
return \Piwik\Plugin\Manager::getInstance()->getPluginsToLoadDuringTests();
}

public function setUp()
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPUnit/TestingEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static function addHooks()

$config->setTestEnvironment();

$pluginsToLoad = \Piwik\Plugin\Manager::$pluginsToLoadForTests;
$pluginsToLoad = \Piwik\Plugin\Manager::getInstance()->getPluginsToLoadDuringTests();
$config->Plugins = array('Plugins' => $pluginsToLoad);

$trackerPluginsToLoad = array(
Expand Down

0 comments on commit 9742718

Please sign in to comment.