Skip to content

Commit aaff0ae

Browse files
authored
Adds a test for UpdateCommand (composer#11724)
* test: Interactive mode should throw if no package * PHPStan fix. Missing return type on test method
1 parent d463df1 commit aaff0ae

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/Composer/Test/Command/UpdateCommandTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
namespace Composer\Test\Command;
1414

1515
use Composer\Test\TestCase;
16+
use InvalidArgumentException;
1617

1718
class UpdateCommandTest extends TestCase
1819
{
@@ -101,4 +102,14 @@ public static function provideUpdates(): \Generator
101102
OUTPUT
102103
];
103104
}
105+
106+
public function testInteractiveModeThrowsIfNoPackageEntered(): void
107+
{
108+
$this->expectException(InvalidArgumentException::class);
109+
$this->expectExceptionMessage('You must enter minimum one package.');
110+
111+
$appTester = $this->getApplicationTester();
112+
$appTester->setInputs(['']);
113+
$appTester->run(['command' => 'update', '--interactive' => true]);
114+
}
104115
}

0 commit comments

Comments
 (0)