diff --git a/tests/Composer/Test/Command/UpdateCommandTest.php b/tests/Composer/Test/Command/UpdateCommandTest.php index 5564eafae..cf84015e1 100644 --- a/tests/Composer/Test/Command/UpdateCommandTest.php +++ b/tests/Composer/Test/Command/UpdateCommandTest.php @@ -13,6 +13,7 @@ namespace Composer\Test\Command; use Composer\Test\TestCase; +use InvalidArgumentException; class UpdateCommandTest extends TestCase { @@ -101,4 +102,14 @@ Run `composer require root/req` or `composer require root/req:^2` instead to rep OUTPUT ]; } + + public function testInteractiveModeThrowsIfNoPackageEntered(): void + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('You must enter minimum one package.'); + + $appTester = $this->getApplicationTester(); + $appTester->setInputs(['']); + $appTester->run(['command' => 'update', '--interactive' => true]); + } }