mirror of
https://github.com/composer/composer
synced 2025-05-09 08:32:56 +00:00
DefaultPolicy test: pick package providing newest virtual package version
This commit is contained in:
parent
0c30610fdc
commit
55d5e55195
1 changed files with 20 additions and 0 deletions
|
@ -119,6 +119,26 @@ class DefaultPolicyTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertEquals($expected, $selected);
|
||||
}
|
||||
|
||||
public function testSelectNewestProvider()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
|
||||
$this->repo->addPackage($packageA = new MemoryPackage('A', '1.0'));
|
||||
$this->repo->addPackage($packageB = new MemoryPackage('B', '2.0'));
|
||||
|
||||
$packageA->setProvides(array(new Link('A', 'X', new VersionConstraint('==', '2.0'), 'provides')));
|
||||
$packageB->setProvides(array(new Link('B', 'X', new VersionConstraint('==', '1.0'), 'provides')));
|
||||
|
||||
$this->pool->addRepository($this->repo);
|
||||
|
||||
$literals = array(new Literal($packageA, true), new Literal($packageB, true));
|
||||
$expected = array(new Literal($packageA, true));
|
||||
|
||||
$selected = $this->policy->selectPreferedPackages($this->pool, $this->repoInstalled, $literals);
|
||||
|
||||
$this->assertEquals($expected, $selected);
|
||||
}
|
||||
|
||||
public function testSelectNonReplacingFromSameRepo()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue