Ejemplo n.º 1
0
 public function testFixtures()
 {
     $this->createFixtures();
     $directories = FileSystemUtils::listDirectories($this->workDir . '/.composer/global');
     $this->assertEquals('testorg', implode(',', $directories));
     $directories = FileSystemUtils::listDirectories($this->workDir . '/.composer/global/testorg');
     $this->assertEquals('testproject', implode(',', $directories));
     $projects = FileSystemUtils::allInstalledProjectsInBaseDir($this->workDir . '/.composer/global');
     $this->assertEquals('testorg/testproject', implode(',', $projects));
 }
Ejemplo n.º 2
0
 public function testAllInstalledProjectsInBaseDir()
 {
     $projects = FileSystemUtils::allInstalledProjectsInBaseDir(__DIR__ . '/fixtures/global');
     $this->assertEquals('org/example', implode(',', $projects));
 }
Ejemplo n.º 3
0
 /**
  * Run `composer global update`. Not only do we want to update the
  * "global" Composer project, we also want to update all of the
  * "isolated" projects installed via cgr in ~/.composer/global.
  *
  * @param string $command The path to composer
  * @param array $composerArgs Anything from the global $argv to be passed
  *   on to Composer
  * @param array $projects A list of projects to update.
  * @param array $options User options from the command line; see
  *   $optionDefaultValues in the main() function.
  * @return array
  */
 public function updateCommand($execPath, $composerArgs, $projects, $options)
 {
     // If 'projects' list is empty, make a list of everything currently installed
     if (empty($projects)) {
         $projects = FileSystemUtils::allInstalledProjectsInBaseDir($options['base-dir']);
         $projects = $this->flipProjectsArray($projects);
     }
     return $this->generalCommand('update', $execPath, $composerArgs, $projects, $options);
 }