Skip to content

TASK: Update to PHPUnit 11#3563

Open
kdambekalns wants to merge 38 commits into
neos:8.4from
kdambekalns:task/update-phpunit-11
Open

TASK: Update to PHPUnit 11#3563
kdambekalns wants to merge 38 commits into
neos:8.4from
kdambekalns:task/update-phpunit-11

Conversation

@kdambekalns

Copy link
Copy Markdown
Member

Upgrade instructions

The only thing you might need to adjust (besides catering to all the changes in PhpUnit 11), is the signature of getAccessibleMock() in our base testcase class. The arguments

  • $callAutoload
  • $callOriginalMethods
  • $proxyTarget

have been removed, as the underlying PHPUnit methods are deprecated.

Review instructions

All tests should still pass – have fun verifying they still do test the correct stuff.

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed (OH YEAH!)
  • The PR is created against the lowest maintained branch – no, but 8.4 is correct for this PR
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

kdambekalns and others added 30 commits May 27, 2026 18:09
…using PHPUnitSetList::PHPUNIT_90
…using PHPUnitSetList::PHPUNIT_100
Also changes non-assertion methods called statically to be called
non-statically (e.g. `self::any()` becomes `$this->any()`).
From `PHPUnitSetList::PHPUNIT_100`
From `PHPUnitSetList::PHPUNIT_CODE_QUALITY`, applied rules:

* AddInstanceofAssertForNullableInstanceRector
* AssertCompareOnCountableWithMethodToAssertCountRector
* AssertComparisonToSpecificMethodRector
* AssertEmptyNullableObjectToAssertInstanceofRector
* AssertEqualsOrAssertSameFloatParameterToSpecificMethodsTypeRector
* AssertEqualsToSameRector
* AssertFuncCallToPHPUnitAssertRector
* AssertInstanceOfComparisonRector
* AssertIssetToSpecificMethodRector
* AssertSameBoolNullToSpecificMethodRector
* AssertSameTrueFalseToAssertTrueFalseRector
* AssertTrueFalseToSpecificMethodRector
* CreateStubOverCreateMockArgRector
* DataProviderArrayItemsNewLinedRector
* DeclareStrictTypesTestsRector
* DecorateWillReturnMapWithExpectsMockRector
* ExpressionCreateMockToCreateStubRector
* FinalizeTestCaseClassRector
* FlipAssertRector
* GetMockBuilderGetMockToCreateMockRector
* MatchAssertSameExpectedTypeRector
* NarrowUnusedSetUpDefinedPropertyRector
* RemoveExpectAnyFromMockRector
* RemoveNeverUsedMockPropertyRector
* ScalarArgumentToExpectedParamTypeRector
* SimplifyForeachInstanceOfRector
* StringCastAssertStringContainsStringRector
* TypeWillReturnCallableArrowFunctionRector
* UseSpecificWillMethodRector
* YieldDataProviderRector
From `PHPUnitSetList::PHPUNIT_CODE_QUALITY`, applied rules:

* DecorateWillReturnMapWithExpectsMockRector
* InlineStubPropertyToCreateStubMethodCallRector
* PropertyCreateMockToCreateStubRector
From `PHPUnitSetList::PHPUNIT_CODE_QUALITY`, applied rules:

* BareCreateMockAssignToDirectUseRector
* CreateStubOverCreateMockArgRector
and along the way shorten class names using imports.

The use of annotations is deprecated in PHPUnit.
… that used to be cast into an exception by PHPUnit.
Drops these arguments from `getAccessibleMock()`:

- `$callAutoload`
- `$callOriginalMethods`
- `$proxyTarget`

The underlying PHPUnit methods are deprecated.
PHPUnit 11 reserves the small/medium/large group names; they must be
the dedicated attributes.
@kdambekalns

Copy link
Copy Markdown
Member Author

See neos/flow-development-distribution#92 for a fix that should do the trick.

@kdambekalns kdambekalns mentioned this pull request Jun 4, 2026
6 tasks
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.

2 participants