10000 [Console] Add test for default InputArgument value with multiple modes · symfony/symfony@af9c97c · GitHub
[go: up one dir, main page]

Skip to content

Commit af9c97c

Browse files
committed
[Console] Add test for default InputArgument value with multiple modes
1 parent 484ac81 commit af9c97c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Symfony/Component/Console/Tests/Input/InputArgumentTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ public function testSetDefaultWithRequiredArgument()
8888
$argument->setDefault('default');
8989
}
90< 8927 /td>90

91+
public function testSetDefaultWithRequiredArrayArgument()
92+
{
93+
$this->expectException(\LogicException::class);
94+
$this->expectExceptionMessage('Cannot set a default value except for InputArgument::OPTIONAL mode.');
95+
$argument = new InputArgument('foo', InputArgument::REQUIRED | InputArgument::IS_ARRAY);
96+
$argument->setDefault([]);
97+
}
98+
9199
public function testSetDefaultWithArrayArgument()
92100
{
93101
$this->expectException(\LogicException::class);

0 commit comments

Comments
 (0)
0