|
|
@@ -695,9 +695,9 @@ class ConsoleOptionParserTest extends TestCase
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * test that no exception is triggered when help is being generated
|
|
|
+ * test that no exception is triggered for required arguments when help is being generated
|
|
|
*/
|
|
|
- public function testHelpNoExceptionWhenGettingHelp(): void
|
|
|
+ public function testHelpNoExceptionForRequiredArgumentsWhenGettingHelp(): void
|
|
|
{
|
|
|
$parser = new ConsoleOptionParser('mycommand', false);
|
|
|
$parser->addOption('test', ['help' => 'A test option.'])
|
|
|
@@ -708,6 +708,19 @@ class ConsoleOptionParserTest extends TestCase
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * test that no exception is triggered for required options when help is being generated
|
|
|
+ */
|
|
|
+ public function testHelpNoExceptionForRequiredOptionsWhenGettingHelp(): void
|
|
|
+ {
|
|
|
+ $parser = new ConsoleOptionParser('mycommand', false);
|
|
|
+ $parser->addOption('test', ['help' => 'A test option.'])
|
|
|
+ ->addOption('model', ['help' => 'The model to make.', 'required' => true]);
|
|
|
+
|
|
|
+ $result = $parser->parse(['--help']);
|
|
|
+ $this->assertTrue($result[0]['help']);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* test that help() with a command param shows the help for a subcommand
|
|
|
*/
|
|
|
public function testHelpSubcommandHelp(): void
|