mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Support for Abandoned in Packages
Added parsing for abandoned property into the CompletePackage Object.
This commit is contained in:
parent
1e4229e22a
commit
d6d087d348
7 changed files with 105 additions and 3 deletions
|
@ -117,7 +117,8 @@ class ArrayLoaderTest extends \PHPUnit_Framework_TestCase
|
|||
'archive' => array(
|
||||
'exclude' => array('/foo/bar', 'baz', '!/foo/bar/baz'),
|
||||
),
|
||||
'transport-options' => array('ssl' => array('local_cert' => '/opt/certs/test.pem'))
|
||||
'transport-options' => array('ssl' => array('local_cert' => '/opt/certs/test.pem')),
|
||||
'abandoned' => 'foo/bar'
|
||||
);
|
||||
|
||||
$package = $this->loader->load($config);
|
||||
|
@ -138,4 +139,28 @@ class ArrayLoaderTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertInstanceOf('Composer\Package\AliasPackage', $package);
|
||||
$this->assertEquals('1.0.x-dev', $package->getPrettyVersion());
|
||||
}
|
||||
|
||||
public function testAbandoned()
|
||||
{
|
||||
$config = array(
|
||||
'name' => 'A',
|
||||
'version' => '1.2.3.4',
|
||||
'abandoned' => 'foo/bar'
|
||||
);
|
||||
|
||||
$package = $this->loader->load($config);
|
||||
$this->assertTrue($package->isAbandoned());
|
||||
$this->assertEquals('foo/bar', $package->getReplacementPackage());
|
||||
}
|
||||
|
||||
public function testNotAbandoned()
|
||||
{
|
||||
$config = array(
|
||||
'name' => 'A',
|
||||
'version' => '1.2.3.4'
|
||||
);
|
||||
|
||||
$package = $this->loader->load($config);
|
||||
$this->assertFalse($package->isAbandoned());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue