1
0
Fork 0
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:
Travis Carden 2023-10-27 05:36:59 -04:00 committed by GitHub
parent cc653161c3
commit aefa46dfba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 99 additions and 3 deletions

View file

@ -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([