Skip to content
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

Numeric @ticket or @group annotations no longer work #3502

Closed
SergeyBiryukov opened this issue Jan 30, 2019 · 5 comments
Closed

Numeric @ticket or @group annotations no longer work #3502

SergeyBiryukov opened this issue Jan 30, 2019 · 5 comments
Assignees
Labels
type/bug Something is broken

Comments

@SergeyBiryukov
Copy link

Q A
PHPUnit version 7.5.2
PHP version 7.2.14
Installation Method PHAR

In WordPress project, a lot of tests include a @ticket annotation with a numeric ticket ID, for example:

/**
 * @ticket 21117
 */

A test with this annotation could previously be executed by running phpunit --group 21117.

This no longer works in PHPUnit 7.2+ due to a strict in_array() check introduced in 39294df.

phpunit list-groups does include 21117, however running phpunit --group 21117 results in a No tests executed! message.

The documentation for @group has an example of @group bug2204, but it does not say that group cannot be numeric, so I'm assuming a numeric group is still valid.

Looking at GroupFilterIterator::__construct(), $group is an integer there, however $groups is an array of strings, so in_array($group, $groups, true) returns false.

Could we either cast $group to a string or remove the strict check?

@sebastianbergmann sebastianbergmann self-assigned this Jan 30, 2019
@sebastianbergmann sebastianbergmann added the type/bug Something is broken label Jan 30, 2019
@sebastianbergmann
Copy link
Owner

@willemstuursma Can you have a look, please?

@epdenouden
Copy link
Contributor

@sebastianbergmann @willemstuursma if Willem is busy with other things I can make a fix

@sebastianbergmann
Copy link
Owner

That would be great.

@epdenouden
Copy link
Contributor

Okidoki, will do!

@willemstuursma
Copy link
Contributor

Thanks @epdenouden!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is broken
Projects
None yet
Development

No branches or pull requests

4 participants