Skip to content

TASK: Update to PHPUnit 11 - #183

Merged
kdambekalns merged 5 commits into
neos:mainfrom
kdambekalns:task/update-phpunit-11
Aug 13, 2026
Merged

kdambekalns merged 5 commits into
neos:mainfrom
kdambekalns:task/update-phpunit-11

Conversation

@kdambekalns

Copy link
Copy Markdown
Member

No description provided.

PhpUnit 11 deprecated metadata in doc comments, so `@test`,
`@dataProvider` and `@group large` are replaced by the `#[Test]`,
`#[DataProvider]` and `#[Large]` attributes across all tests.
PhpUnit 10 deprecated and PhpUnit 11 no longer supports non-static
data providers, they are called without instantiating the test case.
Replace inline fully qualified and namespace-prefixed class references
with `use` imports in test classes.
Update the test suites to the mocking API supported by PHPUnit 11:

* `->will(self::returnValue(…))` becomes `->willReturn(…)`, the same
  for `returnCallback`, `returnSelf` and `throwException`
* `setMethods()` becomes `onlyMethods()`
* `withConsecutive()` is gone, so those expectations are rewritten
  using an invocation matcher and `willReturnCallback()` that checks
  `numberOfInvocations()`

No test behaviour is changed.
@kdambekalns kdambekalns self-assigned this Aug 11, 2026
Flow 8.0 through 8.3 ship older PhpUnit versions, so the test
suite that was updated for PhpUnit 11 can no longer run against
them. Drop those branches from the requirement and the CI test
matrix.

Also update the checkout action to v6.
@kdambekalns

Copy link
Copy Markdown
Member Author

With e79fdfb this needs a minor release.

@kdambekalns

Copy link
Copy Markdown
Member Author

It fails for Flow 9, as that still requires PhpUnit 9…

@kdambekalns
kdambekalns merged commit 41d134e into neos:main Aug 13, 2026
3 of 5 checks passed
@kdambekalns
kdambekalns deleted the task/update-phpunit-11 branch August 13, 2026 13:46
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.

1 participant