mirror of
https://github.com/composer/composer
synced 2025-05-10 17:12:51 +00:00
Take into account prefer-stable and dev packages when computing outdated, refs #5251
This commit is contained in:
parent
2a3b56e82c
commit
6146f7aded
2 changed files with 39 additions and 8 deletions
|
@ -129,6 +129,26 @@ class VersionSelectorTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertSame($package2, $best, 'Latest version should be returned (1.1.0-beta)');
|
||||
}
|
||||
|
||||
public function testMostStableUnstableVersionIsReturned()
|
||||
{
|
||||
$packageName = 'foobar';
|
||||
|
||||
$package2 = $this->createPackage('1.1.0-beta');
|
||||
$package3 = $this->createPackage('1.2.0-alpha');
|
||||
$packages = array($package2, $package3);
|
||||
|
||||
$pool = $this->createMockPool();
|
||||
$pool->expects($this->once())
|
||||
->method('whatProvides')
|
||||
->with($packageName, null, true)
|
||||
->will($this->returnValue($packages));
|
||||
|
||||
$versionSelector = new VersionSelector($pool);
|
||||
$best = $versionSelector->findBestCandidate($packageName, null, null, 'stable');
|
||||
|
||||
$this->assertSame($package2, $best, 'Latest version should be returned (1.1.0-beta)');
|
||||
}
|
||||
|
||||
public function testFalseReturnedOnNoPackages()
|
||||
{
|
||||
$pool = $this->createMockPool();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue