-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[Console] Test convert CompletionInput into string #57570
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,4 +133,19 @@ public static function provideFromStringData() | |
yield ['bin/console cache:clear "multi word string"', ['bin/console', 'cache:clear', '"multi word string"']]; | ||
yield ['bin/console cache:clear \'multi word string\'', ['bin/console', 'cache:clear', '\'multi word string\'']]; | ||
} | ||
|
||
public function testToString() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could perhaps use a dataProvider for this test to avoid duplicating code ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before adding this, I read If it's neccessary, I will implement. And we should implement for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh no, it's not necessary, it's really just a matter of separating the test data from the test itself, but you're right, the code is simple and it's all detail. |
||
{ | ||
$input = CompletionInput::fromTokens(['foo', 'bar', 'baz'], 0); | ||
$this->assertSame('foo| bar baz', (string) $input); | ||
|
||
$input = CompletionInput::fromTokens(['foo', 'bar', 'baz'], 1); | ||
$this->assertSame('foo bar| baz', (string) $input); | ||
|
||
$input = CompletionInput::fromTokens(['foo', 'bar', 'baz'], 2); | ||
$this->assertSame('foo bar baz|', (string) $input); | ||
|
||
$input = CompletionInput::fromTokens(['foo', 'bar', 'baz'], 11); | ||
$this->assertSame('foo bar baz |', (string) $input); | ||
} | ||
} |
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.
int
is missing from this@param
dockblock.