Skip to content
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

Merged
merged 1 commit into from
Mar 23, 2016

Conversation

shadowhand
Copy link
Contributor

Reduces annoyance when failing to define multiple required options by
reporting all missing options in a single exception.

@@ -93,6 +93,7 @@ public function testRequiredOptions()
/**
* @expectedException \Equip\Command\CommandException
* @expectedExceptionCode \Equip\Command\CommandException::MISSING_OPTION
* @expectedExceptionRegExp /required options not defined:/i
Copy link

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`

Copy link
Contributor Author

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.

Copy link

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.
@shadowhand shadowhand force-pushed the feature/exception-multiple-options branch from 3bec61e to 11022ad Compare March 23, 2016 02:58
CommandException::class,
'',
'/required options not defined.+user_id.+article_id/i',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ameech fixed

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Looks good.

@shadowhand shadowhand merged commit e9ac321 into master Mar 23, 2016
@shadowhand shadowhand deleted the feature/exception-multiple-options branch March 23, 2016 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants