-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Add support for error ouput in the CommandTester #27434
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
[Console] Add support for error ouput in the CommandTester #27434
Conversation
@@ -1,6 +1,11 @@ | |||
CHANGELOG | |||
========= | |||
|
|||
4.1.1 |
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.
4.2.0
, new features are for minor releases
@@ -91,6 +117,53 @@ public function setInputs(array $inputs) | |||
return $this; | |||
} | |||
|
|||
/** | |||
* Initialize the output property. |
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.
Initializes
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.
this comment is still relevant, we use the 3rd person form to describe methods
$tester->run(array( | ||
'command' => 'foo', | ||
'foo' => 'bar', | ||
), |
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.
on one line please
* | ||
* @param array $options An array of options | ||
* | ||
* @return self |
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.
this one is not true and returning void is fine. Both @param
and @return
annotations should be removed as they do not provide any information that is not already provided by the method signature.
@@ -42,6 +41,7 @@ public function __construct(Command $command) | |||
* * interactive: Sets the input interactive flag | |||
* * decorated: Sets the output decorated flag | |||
* * verbosity: Sets the output verbosity flag | |||
* * capture_stderr_separately: Make output of stdOut and stdErr separately available |
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.
should be aligned
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.
@cdekok Would you mind addressing the remaining minor comments and rebase your branch?
src/Symfony/Component/Console/Tests/Tester/ApplicationTesterTest.php
Outdated
Show resolved
Hide resolved
35d41c6
to
8a076d1
Compare
8a076d1
to
cec5317
Compare
Nice first contribution! Thank you @cdekok |
…ster (cdekok) This PR was merged into the 4.2-dev branch. Discussion ---------- [Console] Add support for error ouput in the CommandTester Move initialization of the streams to the trait so the `capture_stderr_separately` also works in the CommandTester. | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27422 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Make it possible to test seperate stderr output. ```$tester = new CommandTester($command); $tester->execute( array('foo' => 'bar'), array('capture_stderr_separately' => true) ); $this->assertEquals('foo', $tester->getErrorOutput()); ```` Commits ------- cec5317 [Console] Add support for error ouput in the CommandTester
Move initialization of the streams to the trait so the
capture_stderr_separately
also works in the CommandTester.Make it possible to test seperate stderr output.