diff --git a/tests/Composer/Test/Command/ConfigCommandTest.php b/tests/Composer/Test/Command/ConfigCommandTest.php index 10dd170f2..68653c622 100644 --- a/tests/Composer/Test/Command/ConfigCommandTest.php +++ b/tests/Composer/Test/Command/ConfigCommandTest.php @@ -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]); + } }