8000 Test to ensure that getParameterOption / hasParameterOption throws no… · symfony/symfony@47d0e93 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47d0e93

Browse files
Test to ensure that getParameterOption / hasParameterOption throws no warnings.
1 parent 242e6fc commit 47d0e93

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,21 @@ public function testHasParameterOptionEdgeCasesAndLimitations()
337337
$this->assertFalse($input->hasParameterOption('-fh'), '->hasParameterOption() returns true if the given short option is in the raw input');
338338
}
339339

340+
public function testNoWarningOnInvalidParameterOption()
341+
{
342+
$input = new ArgvInput(array('cli.php', '-edev'));
343+
344+
// Control.
345+
$this->assertTrue($input->hasParameterOption(array('-e', '')));
346+
// No warning is thrown if https://github.com/symfony/symfony/pull/26156 is fixed
347+
$this->assertFalse($input->hasParameterOption(array('-m', '')));
348+
349+
// Control.
350+
$this->assertEquals('dev', $input->getParameterOption(array('-e', '')));
351+
// No warning is thrown if https://github.com/symfony/symfony/pull/26156 is fixed
352+
$this->assertEquals('', $input->getParameterOption(array('-m', '')));
353+
}
354+
340355
public function testToString()
341356
{
342357
$input = new ArgvInput(array('cli.php', '-f', 'foo'));

0 commit comments

Comments
 (0)
0