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
|
@ -94,6 +94,20 @@ class DefaultPolicyTest extends TestCase
|
|||
$this->assertEquals($expected, $selected);
|
||||
}
|
||||
|
||||
public function testSelectNewestWithDevPicksNonDev()
|
||||
{
|
||||
$this->repo->addPackage($packageA1 = $this->getPackage('A', 'dev-foo'));
|
||||
$this->repo->addPackage($packageA2 = $this->getPackage('A', '1.0.0'));
|
||||
$this->pool->addRepository($this->repo);
|
||||
|
||||
$literals = array($packageA1->getId(), $packageA2->getId());
|
||||
$expected = array($packageA2->getId());
|
||||
|
||||
$selected = $this->policy->selectPreferedPackages($this->pool, array(), $literals);
|
||||
|
||||
$this->assertEquals($expected, $selected);
|
||||
}
|
||||
|
||||
public function testSelectNewestOverInstalled()
|
||||
{
|
||||
$this->repo->addPackage($packageA = $this->getPackage('A', '2.0'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue