-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report all missing options at once #5
Conversation
@@ -93,6 +93,7 @@ public function testRequiredOptions() | |||
/** | |||
* @expectedException \Equip\Command\CommandException | |||
* @expectedExceptionCode \Equip\Command\CommandException::MISSING_OPTION | |||
* @expectedExceptionRegExp /required options not defined:/i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I'm missing something, it would be nice to see a test that lists of the missing options.
required options not defined: `user_id`, `article_id`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I suppose... I figured adding a message that definitely comes from missingOptions
would be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just doesn't cover the:
`%s`', implode('`, `', $names)
portion of it.
Reduces annoyance when failing to define multiple required options by reporting all missing options in a single exception.
3bec61e
to
11022ad
Compare
CommandException::class, | ||
'', | ||
'/required options not defined.+user_id.+article_id/i', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ameech fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Looks good.
Reduces annoyance when failing to define multiple required options by
reporting all missing options in a single exception.