1
0
Fork 0
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:
Nicolas Grekas 2020-10-08 12:33:16 +02:00
parent 2c6a9aba32
commit 893fbfcb89
6 changed files with 59 additions and 4 deletions

View file

@ -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);
}
/**