-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Use @<data-set-name> format (compatible with --filter CLI option) in defect messages
#6272
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
staabm
commented
Jul 12, 2025
| /** | ||
| * @internal This method is not covered by the backward compatibility promise for PHPUnit | ||
| */ | ||
| final public function dataSetAsString(): string |
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.
since TestDox formatter does not use the className::methodName <dataset> format, I did not change the format in this method itself but created a new dataSetAsFilterString for use only in the default-printer
|
commit 1&2 are pure refactoring. the actual change is in commit 3 |
--filter CLI option compatible error format@<data-set-name> format (compatible with --filter CLI option) in defect messages
nicolas-grekas
added a commit
to symfony/symfony
that referenced
this pull request
Aug 12, 2025
This PR was merged into the 7.4 branch. Discussion ---------- run tests with PHPUnit 12.3 | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT The test updates reflect the following changes in PHPUnit 12.2 and 12.3: - a warning is emitted when a data provider provides data sets that have more values than the test method consuming the data set - the format in which data sets are displayed in test reports has changed affecting the modified test in the PhpUnitBridge (see sebastianbergmann/phpunit#6272) - errors triggered in the `tearDown()` method of skipped tests are no longer silence affecting the modified tests in the Form component where the `$defaultLocale` property is not initialised (see sebastianbergmann/phpunit#6281) Commits ------- cf7e41e run tests with PHPUnit 12.3
symfony-splitter
pushed a commit
to symfony/form
that referenced
this pull request
Aug 12, 2025
This PR was merged into the 7.4 branch. Discussion ---------- run tests with PHPUnit 12.3 | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT The test updates reflect the following changes in PHPUnit 12.2 and 12.3: - a warning is emitted when a data provider provides data sets that have more values than the test method consuming the data set - the format in which data sets are displayed in test reports has changed affecting the modified test in the PhpUnitBridge (see sebastianbergmann/phpunit#6272) - errors triggered in the `tearDown()` method of skipped tests are no longer silence affecting the modified tests in the Form component where the `$defaultLocale` property is not initialised (see sebastianbergmann/phpunit#6281) Commits ------- cf7e41e1092 run tests with PHPUnit 12.3
symfony-splitter
pushed a commit
to symfony/framework-bundle
that referenced
this pull request
Aug 12, 2025
This PR was merged into the 7.4 branch. Discussion ---------- run tests with PHPUnit 12.3 | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT The test updates reflect the following changes in PHPUnit 12.2 and 12.3: - a warning is emitted when a data provider provides data sets that have more values than the test method consuming the data set - the format in which data sets are displayed in test reports has changed affecting the modified test in the PhpUnitBridge (see sebastianbergmann/phpunit#6272) - errors triggered in the `tearDown()` method of skipped tests are no longer silence affecting the modified tests in the Form component where the `$defaultLocale` property is not initialised (see sebastianbergmann/phpunit#6281) Commits ------- cf7e41e1092 run tests with PHPUnit 12.3
symfony-splitter
pushed a commit
to symfony/yaml
that referenced
this pull request
Aug 12, 2025
This PR was merged into the 7.4 branch. Discussion ---------- run tests with PHPUnit 12.3 | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT The test updates reflect the following changes in PHPUnit 12.2 and 12.3: - a warning is emitted when a data provider provides data sets that have more values than the test method consuming the data set - the format in which data sets are displayed in test reports has changed affecting the modified test in the PhpUnitBridge (see sebastianbergmann/phpunit#6272) - errors triggered in the `tearDown()` method of skipped tests are no longer silence affecting the modified tests in the Form component where the `$defaultLocale` property is not initialised (see sebastianbergmann/phpunit#6281) Commits ------- cf7e41e1092 run tests with PHPUnit 12.3
symfony-splitter
pushed a commit
to symfony/security-bundle
that referenced
this pull request
Aug 12, 2025
This PR was merged into the 7.4 branch. Discussion ---------- run tests with PHPUnit 12.3 | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT The test updates reflect the following changes in PHPUnit 12.2 and 12.3: - a warning is emitted when a data provider provides data sets that have more values than the test method consuming the data set - the format in which data sets are displayed in test reports has changed affecting the modified test in the PhpUnitBridge (see sebastianbergmann/phpunit#6272) - errors triggered in the `tearDown()` method of skipped tests are no longer silence affecting the modified tests in the Form component where the `$defaultLocale` property is not initialised (see sebastianbergmann/phpunit#6281) Commits ------- cf7e41e1092 run tests with PHPUnit 12.3
symfony-splitter
pushed a commit
to symfony/console
that referenced
this pull request
Aug 12, 2025
This PR was merged into the 7.4 branch. Discussion ---------- run tests with PHPUnit 12.3 | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT The test updates reflect the following changes in PHPUnit 12.2 and 12.3: - a warning is emitted when a data provider provides data sets that have more values than the test method consuming the data set - the format in which data sets are displayed in test reports has changed affecting the modified test in the PhpUnitBridge (see sebastianbergmann/phpunit#6272) - errors triggered in the `tearDown()` method of skipped tests are no longer silence affecting the modified tests in the Form component where the `$defaultLocale` property is not initialised (see sebastianbergmann/phpunit#6281) Commits ------- cf7e41e1092 run tests with PHPUnit 12.3
symfony-splitter
pushed a commit
to symfony/validator
that referenced
this pull request
Aug 12, 2025
This PR was merged into the 7.4 branch. Discussion ---------- run tests with PHPUnit 12.3 | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT The test updates reflect the following changes in PHPUnit 12.2 and 12.3: - a warning is emitted when a data provider provides data sets that have more values than the test method consuming the data set - the format in which data sets are displayed in test reports has changed affecting the modified test in the PhpUnitBridge (see sebastianbergmann/phpunit#6272) - errors triggered in the `tearDown()` method of skipped tests are no longer silence affecting the modified tests in the Form component where the `$defaultLocale` property is not initialised (see sebastianbergmann/phpunit#6281) Commits ------- cf7e41e1092 run tests with PHPUnit 12.3
symfony-splitter
pushed a commit
to symfony/var-dumper
that referenced
this pull request
Aug 12, 2025
This PR was merged into the 7.4 branch. Discussion ---------- run tests with PHPUnit 12.3 | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT The test updates reflect the following changes in PHPUnit 12.2 and 12.3: - a warning is emitted when a data provider provides data sets that have more values than the test method consuming the data set - the format in which data sets are displayed in test reports has changed affecting the modified test in the PhpUnitBridge (see sebastianbergmann/phpunit#6272) - errors triggered in the `tearDown()` method of skipped tests are no longer silence affecting the modified tests in the Form component where the `$defaultLocale` property is not initialised (see sebastianbergmann/phpunit#6281) Commits ------- cf7e41e1092 run tests with PHPUnit 12.3
schlndh
added a commit
to schlndh/phpunit
that referenced
this pull request
Sep 12, 2025
As far as I can tell the goal was to change the test name printed by the default printer to make it easier to copy-paste it into --filter. Example: 1) PHPUnit\TestFixture\DataProviderFilterTest::testFalse@other false test2 with data (false) Into: --filter 'testFalse@other false test2' However, the PR changed the test name more broadly than necessary. This broke --filter pattern used by PHPStorm. E.g: --filter '/PHPUnit\\TestFixture\\DataProviderFilterTest::testFalse with data set \"other false test\"$/'
schlndh
added a commit
to schlndh/phpunit
that referenced
this pull request
Sep 12, 2025
It was broken by PR sebastianbergmann#6272. As far as I can tell the goal was to change the test name printed by the default printer to make it easier to copy-paste it into --filter. Example: 1) PHPUnit\TestFixture\DataProviderFilterTest::testFalse@other false test2 with data (false) Into: --filter 'testFalse@other false test2' However, the PR changed the test name more broadly than necessary. This broke --filter pattern used by PHPStorm. E.g: --filter '/PHPUnit\\TestFixture\\DataProviderFilterTest::testFalse with data set \"other false test\"$/'
schlndh
added a commit
to schlndh/phpunit
that referenced
this pull request
Oct 8, 2025
It was broken by PR sebastianbergmann#6272. As far as I can tell the goal was to change the test name printed by the default printer to make it easier to copy-paste it into --filter. Example: 1) PHPUnit\TestFixture\DataProviderFilterTest::testFalse@other false test2 with data (false) Into: --filter 'testFalse@other false test2' However, the PR changed the test name more broadly than necessary. This broke --filter pattern used by PHPStorm. E.g: --filter '/PHPUnit\\TestFixture\\DataProviderFilterTest::testFalse with data set \"other false test\"$/'
sebastianbergmann
pushed a commit
that referenced
this pull request
Oct 9, 2025
It was broken by PR #6272. As far as I can tell the goal was to change the test name printed by the default printer to make it easier to copy-paste it into --filter. Example: 1) PHPUnit\TestFixture\DataProviderFilterTest::testFalse@other false test2 with data (false) Into: --filter 'testFalse@other false test2' However, the PR changed the test name more broadly than necessary. This broke --filter pattern used by PHPStorm. E.g: --filter '/PHPUnit\\TestFixture\\DataProviderFilterTest::testFalse with data set \"other false test\"$/'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature/configuration/cli
feature/data-provider
Data Providers
feature/test-runner
CLI test runner
type/enhancement
A new idea that should be implemented
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #6260
After this PR the default phpunit result printer will format errors the same way the
--filterCLI option expects them.that way the user can copy/paste the tool output and re-use it as the CLI filter option value:
phpunit output for numbered datasets:
CLI option for numbered datasets:
--filter "testSuiteSorterDefectsWithDataProviderTest::testOne#1"phpunit output for named datasets:
CLI option for named datasets:
--filter "testSuiteSorterDefectsWithDataProviderTest::testOne@data-set"