Adds a test for invalid arg combo (#11783)
parent
d00e38a038
commit
3be0ca8467
|
@ -13,6 +13,7 @@
|
||||||
namespace Composer\Test\Command;
|
namespace Composer\Test\Command;
|
||||||
|
|
||||||
use Composer\Test\TestCase;
|
use Composer\Test\TestCase;
|
||||||
|
use RuntimeException;
|
||||||
|
|
||||||
class ConfigCommandTest extends TestCase
|
class ConfigCommandTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@ -139,4 +140,13 @@ class ConfigCommandTest extends TestCase
|
||||||
'{"foo":{"type":"vcs","url":"https://example.org"}}',
|
'{"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]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue