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

Tests/TypeIntersectionTest: use named data sets and other tweaks #270

Merged
merged 2 commits into from
Jan 14, 2024

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jan 14, 2024

Description

Tests/TypeIntersectionTest: fix order of tests

The test order in the test case file was at times confusing (by the looks of it caused by incorrect merge conflict resolution, which hasn't kept tests which were grouped together, together).

Fixed now.

Tests/TypeIntersectionTest: use named data sets

With non-named data sets, when a test fails, PHPUnit will display the number of the test which failed.

With tests which have a lot of data sets, this makes it interesting (and time-consuming) to debug those, as one now has to figure out which of the data sets in the data provider corresponds to that number.

Using named data sets makes debugging failing tests more straight forward as PHPUnit will display the data set name instead of the number.
Using named data sets also documents what exactly each data set is testing.

Includes making the data type in the docblock more specific.

Suggested changelog entry

N/A

The test order in the test case file was at times confusing (by the looks of it caused by incorrect merge conflict resolution, which hasn't kept tests which were grouped together, together).

Fixed now.
With non-named data sets, when a test fails, PHPUnit will display the number of the test which failed.

With tests which have a _lot_ of data sets, this makes it _interesting_ (and time-consuming) to debug those, as one now has to figure out which of the data sets in the data provider corresponds to that number.

Using named data sets makes debugging failing tests more straight forward as PHPUnit will display the data set name instead of the number.
Using named data sets also documents what exactly each data set is testing.

Includes making the data type in the docblock more specific.
@jrfnl jrfnl added this to the 3.8.x Next milestone Jan 14, 2024
@jrfnl jrfnl merged commit e332340 into master Jan 14, 2024
46 checks passed
@jrfnl jrfnl deleted the feature/tests-typeintersection-improvements branch January 14, 2024 06:18
@jrfnl jrfnl modified the milestones: 3.8.x Next, 3.9.0 Jan 19, 2024
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.

1 participant