mirror of
https://github.com/composer/composer
synced 2025-05-10 00:53:06 +00:00
Improve interactive package updates (#11990)
* Improve interactive package updates * Exclude platform packages and up to date packages, follow stability flags, ignore-platform-reqs etc * Add tests and support for lock file + empty lock/vendor --------- Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
This commit is contained in:
parent
12031542ba
commit
be7d9abc66
2 changed files with 94 additions and 35 deletions
|
@ -128,10 +128,47 @@ OUTPUT
|
|||
];
|
||||
}
|
||||
|
||||
public function testInteractiveModeThrowsIfNoPackageToUpdate(): void
|
||||
{
|
||||
$this->initTempComposer([
|
||||
'repositories' => [
|
||||
'packages' => [
|
||||
'type' => 'package',
|
||||
'package' => [
|
||||
['name' => 'root/req', 'version' => '1.0.0'],
|
||||
],
|
||||
],
|
||||
],
|
||||
'require' => [
|
||||
'root/req' => '1.*',
|
||||
],
|
||||
]);
|
||||
$this->createComposerLock([self::getPackage('root/req', '1.0.0')]);
|
||||
self::expectExceptionMessage('Could not find any package with new versions available');
|
||||
|
||||
$appTester = $this->getApplicationTester();
|
||||
$appTester->setInputs(['']);
|
||||
$appTester->run(['command' => 'update', '--interactive' => true]);
|
||||
}
|
||||
|
||||
public function testInteractiveModeThrowsIfNoPackageEntered(): void
|
||||
{
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('You must enter minimum one package.');
|
||||
$this->initTempComposer([
|
||||
'repositories' => [
|
||||
'packages' => [
|
||||
'type' => 'package',
|
||||
'package' => [
|
||||
['name' => 'root/req', 'version' => '1.0.0'],
|
||||
['name' => 'root/req', 'version' => '1.0.1'],
|
||||
],
|
||||
],
|
||||
],
|
||||
'require' => [
|
||||
'root/req' => '1.*',
|
||||
],
|
||||
]);
|
||||
$this->createComposerLock([self::getPackage('root/req', '1.0.0')]);
|
||||
self::expectExceptionMessage('No package named "" is installed.');
|
||||
|
||||
$appTester = $this->getApplicationTester();
|
||||
$appTester->setInputs(['']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue