Skip to content

feat: support PHPUnit 13 - #57

Merged
jdreesen merged 1 commit into
mainfrom
feature/phpunit-13-support
Oct 6, 2026
Merged

jdreesen merged 1 commit into
mainfrom
feature/phpunit-13-support

Conversation

@jdreesen

@jdreesen jdreesen commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Based on #56 (PHPUnit 12 support), so this PR targets that branch. Retarget to main once #56 is merged.

Summary

  • Allow phpunit/phpunit ^13.4 (PHP >= 8.4.1 only) and extend the CI matrix: PHP 8.1-8.3 are excluded, plus one lowest-dependency run (Pimcore 2026 / PHP 8.4); --fail-on-risky now applies to the newest PHPUnit.
  • PHPUnit 13 replaced the private TestCase::$data array with a DataSet value object. AttributeProvider writes the data with the configuration objects stripped back via reflection, which no longer worked. That part now goes through a new setProvidedData() that picks the property for the installed PHPUnit version (same style as the existing getTestName()/getProvidedData() switches).
  • PHPStan baseline and composer-dependency-analyser.php ignore the DataSet class on versions that don't have it (reportUnmatched: false / conditional ignore, so both sides stay clean).
  • Everything else removed in PHPUnit 13 isn't used here. DAMA's extension only uses event classes that still exist.
  • README: the "Data Provider" note now recommends only the positional #[DataProvider('...', false)]. PHPUnit marks its attributes @no-named-arguments, so the named validateArgumentCount: false isn't covered by its BC promise (and fails on PHPUnit 10/11). The <details> section for multi-version projects is gone since the positional form works everywhere.
  • CHANGELOG (v0.15.1), CLAUDE.md and test comments updated.

Test plan

  • Full suite locally with PHPUnit 13.4.1 / PHP 8.5.9 / --fail-on-risky: 109 tests, 0 failures, 0 warnings
  • Full suite locally with PHPUnit 12.5.38 (other side of the version switch): same result
  • PHPStan (phpstan-2026.neon) and composer-dependency-analyser clean on PHPUnit 13 and 12
  • CI matrix incl. the new PHPUnit 13 jobs and the PHPUnit 9/10/11/12 jobs (all 43 checks green; the changed AttributeProvider code runs on all of them)

🤖 Generated with Claude Code

@jdreesen
jdreesen added this pull request to stack #58 October 5, 2026 16:19
@jdreesen
jdreesen requested a review from lukadschaak October 5, 2026 16:38
Base automatically changed from feature/phpunit-12-support to main October 6, 2026 15:40
Allow PHPUnit ^13.4 (PHP >= 8.4.1 only) and extend the CI matrix.

PHPUnit 13 replaced the private `TestCase::$data` array with a `DataSet`
value object. AttributeProvider writes the stripped data back via reflection,
so that part now goes through `setProvidedData()`, which picks the right
property for the installed PHPUnit version. The PHPStan baseline and the
dependency analyser config ignore the `DataSet` class on older versions.

The README now recommends only the positional `#[DataProvider('...', false)]`:
PHPUnit doesn't cover attribute parameter names by its BC promise.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jdreesen
jdreesen force-pushed the feature/phpunit-13-support branch from 2d54628 to 6c8c4e1 Compare October 6, 2026 15:40
@jdreesen
jdreesen merged commit e2fb01f into main Oct 6, 2026
43 checks passed
@jdreesen
jdreesen deleted the feature/phpunit-13-support branch October 6, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants