public function testMerge()
 {
     $initialConfig = ['name' => 'init-name', 'description' => 'init-description', 'keywords' => ['init-k1', 'init-k2'], 'homepage' => 'http://init-homepage.com', 'version' => '1.0.0', 'time' => '1999-12-31', 'authors' => [['name' => 'init-author-name', 'email' => '*****@*****.**']], 'autoload' => ['psr-4' => ['init-namespace\\' => ['path1', 'path2']]]];
     $newConfig = ['name' => 'new-name', 'description' => 'new-description', 'keywords' => ['new-k1', 'new-k2'], 'homepage' => 'http://new-homepage.com', 'authors' => [['name' => 'new-author-name', 'email' => '*****@*****.**']], 'autoload' => ['psr-4' => ['new-namespace\\' => ['path1', 'path2']]]];
     $composerConfigMerger = new ComposerConfigMerger();
     $result = $composerConfigMerger->merge($initialConfig, $newConfig);
     $this->assertSame(['name' => 'new-name', 'description' => 'new-description', 'keywords' => ['new-k1', 'new-k2'], 'homepage' => 'http://new-homepage.com', 'authors' => [['name' => 'new-author-name', 'email' => '*****@*****.**']], 'autoload' => ['psr-4' => ['init-namespace\\' => ['path1', 'path2'], 'new-namespace\\' => ['path1', 'path2']]]], $result);
 }
Example #2
0
 /**
  *
  */
 public function resetConfig()
 {
     $merger = new ComposerConfigMerger();
     $this->getService('composer')->setConfig($merger->merge($this->retrieveCurrentConfig(), $this->getService('project')->toConfig()), $this->getService('project')->getDirectoryPath());
     $this->getService('composer')->flushConfig($this->getService('project')->getDirectoryPath());
 }