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

Fix parsing "branch-version"

This commit is contained in:
Nicolas Grekas 2020-10-13 15:16:39 +02:00
parent fec3c6a4e9
commit 4feed8b85c
3 changed files with 17 additions and 4 deletions

View file

@ -202,14 +202,27 @@ class RootPackageLoaderTest extends TestCase
$this->assertEquals("dev-latest-production", $package->getPrettyVersion());
}
public function testLoadExtraBranchVersion()
/**
* @dataProvider provideExtraBranchVersion
*/
public function testLoadExtraBranchVersion($branchVersion)
{
$package = $this->loadPackage(array(
'extra' => array(
'branch-version' => '1.2',
'branch-version' => $branchVersion,
),
));
$this->assertEquals('1.2.x-dev', $package->getPrettyVersion());
}
public function provideExtraBranchVersion()
{
return array(
array('1.2'),
array('1.2.x'),
array('1.2-dev'),
array('1.2.x-dev'),
);
}
}