1
0
Fork 0

Adds a test for UpdateCommand (#11724)

* test: Interactive mode should throw if no package

* PHPStan fix. Missing return type on test method
pull/11753/head
theoboldalex 2023-12-08 17:26:05 +00:00 committed by GitHub
parent d463df1021
commit aaff0ae4df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -13,6 +13,7 @@
namespace Composer\Test\Command; namespace Composer\Test\Command;
use Composer\Test\TestCase; use Composer\Test\TestCase;
use InvalidArgumentException;
class UpdateCommandTest extends TestCase class UpdateCommandTest extends TestCase
{ {
@ -101,4 +102,14 @@ Run `composer require root/req` or `composer require root/req:^2` instead to rep
OUTPUT 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]);
}
} }