mirror of
https://github.com/composer/composer
synced 2025-05-08 16:17:37 +00:00
Add support for "extra.branch-version"
This commit is contained in:
parent
2c6a9aba32
commit
893fbfcb89
6 changed files with 59 additions and 4 deletions
|
@ -72,6 +72,23 @@ class PathRepositoryTest extends TestCase
|
|||
$this->assertNotEmpty($packageVersion);
|
||||
}
|
||||
|
||||
public function testLoadPackageFromFileSystemWithExtraBranchVersion()
|
||||
{
|
||||
$ioInterface = $this->getMockBuilder('Composer\IO\IOInterface')
|
||||
->getMock();
|
||||
|
||||
$config = new \Composer\Config();
|
||||
$versionGuesser = null;
|
||||
|
||||
$repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', 'with-branch-version'));
|
||||
$repository = new PathRepository(array('url' => $repositoryUrl), $ioInterface, $config);
|
||||
$packages = $repository->getPackages();
|
||||
|
||||
$this->assertEquals(1, $repository->count());
|
||||
|
||||
$this->assertTrue($repository->hasPackage($this->getPackage('test/path-branch-versioned', '1.2.x-dev')));
|
||||
}
|
||||
|
||||
public function testLoadPackageFromFileSystemWithWildcard()
|
||||
{
|
||||
$ioInterface = $this->getMockBuilder('Composer\IO\IOInterface')
|
||||
|
@ -85,7 +102,7 @@ class PathRepositoryTest extends TestCase
|
|||
$packages = $repository->getPackages();
|
||||
$names = array();
|
||||
|
||||
$this->assertEquals(2, $repository->count());
|
||||
$this->assertEquals(3, $repository->count());
|
||||
|
||||
$package = $packages[0];
|
||||
$names[] = $package->getName();
|
||||
|
@ -93,8 +110,11 @@ class PathRepositoryTest extends TestCase
|
|||
$package = $packages[1];
|
||||
$names[] = $package->getName();
|
||||
|
||||
$package = $packages[2];
|
||||
$names[] = $package->getName();
|
||||
|
||||
sort($names);
|
||||
$this->assertEquals(array('test/path-unversioned', 'test/path-versioned'), $names);
|
||||
$this->assertEquals(array('test/path-branch-versioned', 'test/path-unversioned', 'test/path-versioned'), $names);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue