Skip to content

Conversation

@oliverquynh
Copy link
Contributor

@oliverquynh oliverquynh commented Jun 28, 2024

Q A
Branch? 5.4
Bug fix? no
New feature? no
Deprecations? no
Issues N/A
License MIT

CompletionInput can be converted into string but there are no tests for it. So, I a simple test here based on it's current behavior.

*
* @param string[] $tokens the set of split tokens (e.g. COMP_WORDS or argv)
* @param $currentIndex the index of the cursor (e.g. COMP_CWORD)
* @param int $currentIndex the index of the cursor (e.g. COMP_CWORD)
Copy link
Contributor Author

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.

@oliverquynh
Copy link
Contributor Author

oliverquynh commented Jun 28, 2024

It's weird. I think the CI error might not be related to this test. Am I right?

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Failures unrelated indeed.

yield ['bin/console cache:clear \'multi word string\'', ['bin/console', 'cache:clear', '\'multi word string\'']];
}

public function testToString()
Copy link
Contributor

Choose a reason for hiding this comment

The 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 ?

Copy link
Contributor Author

@oliverquynh oliverquynh Jun 28, 2024

Choose a reason for hiding this comment

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

Before adding this, I read ArgvInputTest and ArrayInputTest. There both don't use a dataProvider. Personally, I think use or not use dataProvider here is fine because there are only 2-3 cases.

If it's neccessary, I will implement. And we should implement for ArgvInputTest and ArrayInputTest too, shouldn't we?

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

@nicolas-grekas
Copy link
Member

Thank you @seriquynh.

@nicolas-grekas nicolas-grekas merged commit 7beff57 into symfony:5.4 Jun 28, 2024
@oliverquynh oliverquynh deleted the add-test branch June 28, 2024 09:41
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.

4 participants