diff --git a/tests/acceptance/acceptance/console/ConsoleArgument.feature b/tests/acceptance/acceptance/console/ConsoleArgument.feature index 4b329c9..b4e9631 100644 --- a/tests/acceptance/acceptance/console/ConsoleArgument.feature +++ b/tests/acceptance/acceptance/console/ConsoleArgument.feature @@ -37,7 +37,17 @@ Feature: ConsoleArgument { public function configure(): void { - $this->addArgument('required_string', InputArgument::REQUIRED); + $this->addArgument( + 'required_string', + InputArgument::REQUIRED, + 'description', + null, + [ + 'string1', + 'string2', + 'string3', + ] + ); $this->addArgument('required_array', InputArgument::REQUIRED | InputArgument::IS_ARRAY); } @@ -278,3 +288,33 @@ Feature: ConsoleArgument | Type | Message | | Trace | $arg: null\|string | And I see no other errors + + Scenario: Use suggested values for argument + Given I have the following code + """ + class MyCommand extends Command + { + public function configure(): void + { + $this->addArgument( + 'format', + InputArgument::OPTIONAL, + 'The format to use', + null, + [ + 'pdf', + 'excel', + 'csv', + ], + ); + } + + public function execute(InputInterface $input, OutputInterface $output): int + { + return self::SUCCESS; + } + } + """ + When I run Psalm + Then I see no errors + diff --git a/tests/acceptance/acceptance/console/ConsoleOption.feature b/tests/acceptance/acceptance/console/ConsoleOption.feature index 35e759c..4bf20e6 100644 --- a/tests/acceptance/acceptance/console/ConsoleOption.feature +++ b/tests/acceptance/acceptance/console/ConsoleOption.feature @@ -297,3 +297,33 @@ Feature: ConsoleOption | MixedAssignment | Unable to determine the type that $option is being assigned to | | Trace | $option: mixed | And I see no other errors + + Scenario: Using suggested values for option + Given I have the following code + """ + class MyCommand extends Command + { + public function configure(): void + { + $this->addOption( + 'format', + null, + InputOption::VALUE_OPTIONAL, + 'The format to use', + null, + [ + 'pdf', + 'excel', + 'csv', + ], + ); + } + + public function execute(InputInterface $input, OutputInterface $output): int + { + return self::SUCCESS; + } + } + """ + When I run Psalm + Then I see no errors