|
19 | 19 |
|
20 | 20 | class ArgvInputTest extends TestCase
|
21 | 21 | {
|
| 22 | + protected $last_error = ''; |
| 23 | + |
| 24 | + public function customErrorHandler($errno, $errstr, $errfile, $errline) { |
| 25 | + $this->last_error = $errstr . " on line " . $errline . " in file " . $errfile; |
| 26 | + } |
| 27 | + |
22 | 28 | public function testConstructor()
|
23 | 29 | {
|
24 | 30 | $_SERVER['argv'] = array('cli.php', 'foo');
|
@@ -337,6 +343,21 @@ public function testHasParameterOptionEdgeCasesAndLimitations()
|
337 | 343 | $this->assertFalse($input->hasParameterOption('-fh'), '->hasParameterOption() returns true if the given short option is in the raw input');
|
338 | 344 | }
|
339 | 345 |
|
| 346 | + public function testNoWarningOnInvalidParameterOption() |
| 347 | + { |
| 348 | + $input = new ArgvInput(array('cli.php', '-edev')); |
| 349 | + |
| 350 | + // Control. |
| 351 | + $this->assertTrue($input->hasParameterOption(['-e', ''])); |
| 352 | + // No warning is thrown if https://github.com/symfony/symfony/pull/26156 is fixed |
| 353 | + $this->assertFalse($input->hasParameterOption(['-m', ''])); |
| 354 | + |
| 355 | + // Control. |
| 356 | + $this->assertEquals('dev', $input->getParameterOption(['-e', ''])); |
| 357 | + // No warning is thrown if https://github.com/symfony/symfony/pull/26156 is fixed |
| 358 | + $this->assertEquals('', $input->getParameterOption(['-m', ''])); |
| 359 | + } |
| 360 | + |
340 | 361 | public function testToString()
|
341 | 362 | {
|
342 | 363 | $input = new ArgvInput(array('cli.php', '-f', 'foo'));
|
|
0 commit comments