mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Only compare branches as versions in the policy to sort packages, but not in the solver, fixes #1817
This commit is contained in:
parent
950fc7e66e
commit
e848c76cbc
4 changed files with 44 additions and 6 deletions
|
@ -72,6 +72,8 @@ class VersionConstraintTest extends \PHPUnit_Framework_TestCase
|
|||
array('==', 'dev-foo-bist', '==', 'dev-foo-aist'),
|
||||
array('<=', 'dev-foo-bist', '>=', 'dev-foo-aist'),
|
||||
array('>=', 'dev-foo-bist', '<', 'dev-foo-aist'),
|
||||
array('<', '0.12', '==', 'dev-foo'), // branches are not comparable
|
||||
array('>', '0.12', '==', 'dev-foo'), // branches are not comparable
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -85,4 +87,19 @@ class VersionConstraintTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$this->assertFalse($versionRequire->matches($versionProvide));
|
||||
}
|
||||
|
||||
public function testComparableBranches()
|
||||
{
|
||||
$versionRequire = new VersionConstraint('>', '0.12');
|
||||
$versionProvide = new VersionConstraint('==', 'dev-foo');
|
||||
|
||||
$this->assertFalse($versionRequire->matches($versionProvide));
|
||||
$this->assertFalse($versionRequire->matchSpecific($versionProvide, true));
|
||||
|
||||
$versionRequire = new VersionConstraint('<', '0.12');
|
||||
$versionProvide = new VersionConstraint('==', 'dev-foo');
|
||||
|
||||
$this->assertFalse($versionRequire->matches($versionProvide));
|
||||
$this->assertTrue($versionRequire->matchSpecific($versionProvide, true));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue