1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Refactor repositories handling in config/factory/loader, fixes #828, fixes #826

This commit is contained in:
Jordi Boggiano 2012-06-24 13:03:55 +02:00
parent 74c2fd5f06
commit ffecd39d33
10 changed files with 169 additions and 192 deletions

View file

@ -42,25 +42,11 @@ class RootPackageLoaderTest extends \PHPUnit_Framework_TestCase
return 0;
});
$loader = new RootPackageLoader($manager, new Config, null, $processExecutor);
$config = new Config;
$config->merge(array('repositories' => array('packagist' => false)));
$loader = new RootPackageLoader($manager, $config, null, $processExecutor);
$package = $loader->load(array());
$this->assertEquals("dev-$commitHash", $package->getVersion());
}
public function testAllowsDisabledDefaultRepository()
{
$loader = new RootPackageLoader(
new RepositoryManager(
$this->getMock('Composer\\IO\\IOInterface'),
$this->getMock('Composer\\Config')
),
new Config()
);
$repos = array(array('packagist' => false));
$package = $loader->load(array('repositories' => $repos));
$this->assertEquals($repos, $package->getRepositories());
}
}