mirror of
https://github.com/composer/composer
synced 2025-05-10 00:53:06 +00:00
Add support for "scripts-aliases" in composer.json (#11666)
This commit is contained in:
parent
cc653161c3
commit
aefa46dfba
9 changed files with 99 additions and 3 deletions
|
@ -109,6 +109,32 @@ class RunScriptCommandTest extends TestCase
|
|||
$this->assertStringContainsString('Run the codestyle fixer', $output, 'The custom description for the fix-cs script should be printed');
|
||||
}
|
||||
|
||||
public function testCanDefineAliases(): void
|
||||
{
|
||||
$expectedAliases = ['one', 'two', 'three'];
|
||||
|
||||
$this->initTempComposer([
|
||||
'scripts' => [
|
||||
'test' => '@php test',
|
||||
],
|
||||
'scripts-aliases' => [
|
||||
'test' => $expectedAliases,
|
||||
],
|
||||
]);
|
||||
|
||||
$appTester = $this->getApplicationTester();
|
||||
$appTester->run(['command' => 'test', '--help' => true, '--format' => 'json']);
|
||||
|
||||
$appTester->assertCommandIsSuccessful();
|
||||
|
||||
$output = $appTester->getDisplay();
|
||||
$array = json_decode($output, true);
|
||||
$actualAliases = $array['usage'];
|
||||
array_shift($actualAliases);
|
||||
|
||||
$this->assertSame($expectedAliases, $actualAliases, 'The custom aliases for the test command should be printed');
|
||||
}
|
||||
|
||||
public function testExecutionOfCustomSymfonyCommand(): void
|
||||
{
|
||||
$this->initTempComposer([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue