Skip to content

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

@SergeyBiryukov

Description

@SergeyBiryukov
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?

Metadata

Metadata

Labels

type/bugSomething is broken

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions