public function testGetPluginClasses_returnsStrings()
 {
     $pluginDirPath = realpath(__DIR__ . "/../../../../PHPCI/Plugin/");
     $test = FilesPluginInformation::newFromDir($pluginDirPath);
     $pluginInfos = $test->getPluginClasses();
     $this->assertContainsOnly('string', $pluginInfos);
 }
Esempio n. 2
0
 /**
  * List all enabled plugins, installed and recommend packages.
  * @return string
  */
 public function index()
 {
     $this->requireAdmin();
     $json = $this->getComposerJson();
     $this->view->installedPackages = $json['require'];
     $pluginInfo = new PluginInformationCollection();
     $pluginInfo->add(FilesPluginInformation::newFromDir(PHPCI_DIR . "PHPCI/Plugin/"));
     $pluginInfo->add(ComposerPluginInformation::buildFromYaml(PHPCI_DIR . "vendor/composer/installed.json"));
     $this->view->plugins = $pluginInfo->getInstalledPlugins();
     $this->layout->title = Lang::get('plugins');
     return $this->view->render();
 }
Esempio n. 3
0
 public function index()
 {
     if (!$_SESSION['user']->getIsAdmin()) {
         throw new \Exception('You do not have permission to do that.');
     }
     $this->view->canWrite = is_writable(APPLICATION_PATH . 'composer.json');
     $this->view->required = $this->required;
     $json = $this->getComposerJson();
     $this->view->installedPackages = $json['require'];
     $this->view->suggestedPackages = $json['suggest'];
     $pluginInfo = new PluginInformationCollection();
     $pluginInfo->add(FilesPluginInformation::newFromDir(PHPCI_DIR . "PHPCI/Plugin/"));
     $pluginInfo->add(ComposerPluginInformation::buildFromYaml(PHPCI_DIR . "vendor/composer/installed.json"));
     $this->view->plugins = $pluginInfo->getInstalledPlugins();
     $this->config->set('page_title', 'Plugins');
     return $this->view->render();
 }