1
0
Fork 0
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:
Jordi Boggiano 2013-05-23 18:12:54 +02:00
parent 950fc7e66e
commit e848c76cbc
4 changed files with 44 additions and 6 deletions

View file

@ -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'));