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

Add a complete test for AddUserCommand #480

Merged
merged 4 commits into from Mar 12, 2017

Conversation

dmaicher
Copy link
Contributor

This adds a simple test for AddUserCommand that creates a user non-interactively and interactively.

Fixes #473.


$commandTester = new CommandTester($command);
$commandTester->setInputs($interactiveInputs);
$commandTester->execute(array_merge(['command' => $command->getName()], $inputArgs));
Copy link
Member

Choose a reason for hiding this comment

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

Is the command argument required? I think we removed this in some past Symfony version ... but I could be perfectly wrong 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are absolutely right! 😄 👍 removed it.

$isAdmin ? ['--admin' => 1] : [],
// these are the responses given to the questions asked by the command
// to get the value of the missing required arguments
array_values($this->userdata)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@javiereguiluz $this->userData 😉

@javiereguiluz javiereguiluz changed the title add simple test for AddUserCommand Add a complete test for AddUserCommand Mar 12, 2017
@javiereguiluz
Copy link
Member

Thanks @dmaicher.

@javiereguiluz javiereguiluz merged commit 774adca into symfony:master Mar 12, 2017
javiereguiluz added a commit that referenced this pull request Mar 12, 2017
…eguiluz)

This PR was merged into the master branch.

Discussion
----------

Add a complete test for AddUserCommand

This adds a simple test for `AddUserCommand` that creates a user non-interactively and interactively.

Fixes #473.

Commits
-------

774adca Improved the PHPdoc of some methods
c1d23f9 Fixed a variable name
3e15d59 Refactored the code and added some help notes
a08c746 add simple test for AddUserCommand
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.

None yet

2 participants