Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ensure final input of CommandTester works with default#29754

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
chalasr merged 1 commit intosymfony:3.4fromFirehed:patch-1
Jan 4, 2019

Conversation

@Firehed
Copy link
Contributor

QA
Branch?4.x
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

If the final element ofCommandTester::setInputs() is an empty string (to send the default value), the internal stream the tester uses hits EOF and triggers theAborted exception. This appends an additional EOL to the stream after theimplode to simulate one final return key, allowing the final input to use the default value when used in the tester's documented style.

A test has been added to cover the new behavior, which failed before this change.

$stream =fopen('php://memory','r+',false);

fwrite($stream,implode(PHP_EOL,$inputs));
fwrite($stream,implode(PHP_EOL,$inputs).PHP_EOL);
Copy link
Member

@nicolas-grekasnicolas-grekasJan 3, 2019
edited
Loading

Choose a reason for hiding this comment

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

When an empty array is passed, this writes a PHP_EOL. Legit?
Should the code be rewritten as such?

foreach ($inputsas$line) {fwrite($stream,$line.PHP_EOL);}

chalasr and Firehed reacted with thumbs up emoji
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

ping@Simperfit could you review and tell if it's legit to you?
Note that this should target 4.1

Copy link
Member

@chalasrchalasr left a comment
edited
Loading

Choose a reason for hiding this comment

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

Looks good to me (code owner here). 👍 once@nicolas-grekas's comment addressed

@Firehed
Copy link
ContributorAuthor

I prefer that approach too. Changed :)

If the final element of `CommandTester::setInputs()` is an empty string (to send the default value), the internal stream the tester uses hits EOF and triggers the `Aborted` exception. This appends an additional EOL to the stream after the `implode` to simulate one final return key, allowing the final input to use the default value when used in the tester's documented style.
@chalasrchalasr changed the base branch frommaster to3.4January 4, 2019 04:42
@chalasrchalasr modified the milestones:4.1,3.4Jan 4, 2019
@chalasr
Copy link
Member

Rebased on 3.4. Note to mergers: patch needs to be moved toTesterTrait starting from 4.1.

@chalasr
Copy link
Member

Good catch, thanks@Firehed.

@chalasrchalasr merged commit6b87b67 intosymfony:3.4Jan 4, 2019
chalasr pushed a commit that referenced this pull requestJan 4, 2019
…rehed)This PR was merged into the 3.4 branch.Discussion----------Ensure final input of CommandTester works with default| Q             | A| ------------- | ---| Branch?       | 4.x| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -If the final element of `CommandTester::setInputs()` is an empty string (to send the default value), the internal stream the tester uses hits EOF and triggers the `Aborted` exception. This appends an additional EOL to the stream after the `implode` to simulate one final return key, allowing the final input to use the default value when used in the tester's documented style.A test has been added to cover the new behavior, which failed before this change.Commits-------6b87b67 Ensure final input of CommandTester works with default
@chalasr
Copy link
Member

And thank you for contributing to Symfony!

Firehed reacted with heart emoji

This was referencedJan 6, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@chalasrchalasrchalasr approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

4 participants

@Firehed@chalasr@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp