diff --git a/tests/Fixtures/Console/CommandWithArgumentName.php b/tests/Fixtures/Console/CommandWithArgumentName.php new file mode 100644 index 000000000..f0143169b --- /dev/null +++ b/tests/Fixtures/Console/CommandWithArgumentName.php @@ -0,0 +1,24 @@ +writeln($input); + $this->writeln($flag ? 'true' : 'false'); + } +} \ No newline at end of file diff --git a/tests/Integration/Console/ConsoleArgumentBagTest.php b/tests/Integration/Console/ConsoleArgumentBagTest.php index 21866ff8d..5935f3c79 100644 --- a/tests/Integration/Console/ConsoleArgumentBagTest.php +++ b/tests/Integration/Console/ConsoleArgumentBagTest.php @@ -54,8 +54,7 @@ public function test_positional_vs_named_input(): void $this->console ->call('complex a --c=c --b=b --flag') ->assertContains('abc') - ->assertContains('true') - ; + ->assertContains('true'); } public function test_combined_flags(): void @@ -138,4 +137,12 @@ public function test_negative_input(string $name, bool $expected): void $this->assertSame($expected, $bag->findFor($definition)->value); } + + public function test_name_mapping(): void + { + $this->console + ->call('command-with-argument-name --new-name=foo --new-flag') + ->assertSee('foo') + ->assertSee('true'); + } }