Adds a test for UpdateCommand (#11724)
* test: Interactive mode should throw if no package * PHPStan fix. Missing return type on test methodpull/11753/head
parent
d463df1021
commit
aaff0ae4df
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue