1
0
Fork 0

Adds a test for invalid arg combo (#11783)

pull/11786/head
theoboldalex 2024-01-08 10:03:34 +00:00 committed by GitHub
parent d00e38a038
commit 3be0ca8467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,7 @@
namespace Composer\Test\Command;
use Composer\Test\TestCase;
use RuntimeException;
class ConfigCommandTest extends TestCase
{
@ -139,4 +140,13 @@ class ConfigCommandTest extends TestCase
'{"foo":{"type":"vcs","url":"https://example.org"}}',
];
}
public function testConfigThrowsForInvalidArgCombination(): void
{
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('--file and --global can not be combined');
$appTester = $this->getApplicationTester();
$appTester->run(['command' => 'config', '--file' => 'alt.composer.json', '--global' => true]);
}
}