-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] fixes tests #7232
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] fixes tests #7232
Conversation
This PR was merged into the 2.2 branch. Commits ------- 5bf2f71 [Console] added deprecation annotation f95f8e2 [Console] added string input test 4b12118 Revert "merged branch jfsimon/issue-6749 (PR #7220)" Discussion ---------- [Console] fixes tests Previous `StringInputTest::testInputOptionWithGivenString` test was broken. Trying make it pass broke the way `StringInput` is used in the console. Two things to know abour the `StringInput` class in its actual state: * the second argument in the constructor is useless * the `bind` method **must** be called in order to access arguments/options | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes
@@ -35,7 +35,8 @@ public function testInputOptionWithGivenString() | |||
array(new InputOption('foo', null, InputOption::VALUE_REQUIRED)) | |||
); | |||
|
|||
$input = new StringInput('--foo=bar', $definition); | |||
$input = new StringInput('--foo=bar'); | |||
$input->bind($definition); |
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.
@jfsimon Wouldn't it be possible to call bind at the end of the constructor so that the argument is working ?
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.
or maybe to call the parent constructor only after tokenizing ?
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.
And if the argument is deprecated it should be removed from the constructor signature. And you func_get_args instead.
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.
@Tobion there is a pending PR making it work properly again, so there will be no reason to deprecate it because being broken.
@fabpot The previous PR was merged into 2.1 but you only reverted in 2.2 |
Previous
StringInputTest::testInputOptionWithGivenString
test was broken.Trying make it pass broke the way
StringInput
is used in the console.Two things to know abour the
StringInput
class in its actual state:bind
method must be called in order to access arguments/options