Skip to content

[Set] Extract mock-to-stub rules into dedicated PHPUNIT_MOCK_TO_STUB set#688

Merged
TomasVotruba merged 1 commit into
mainfrom
extract-mock-to-stub-set
Jun 29, 2026
Merged

[Set] Extract mock-to-stub rules into dedicated PHPUNIT_MOCK_TO_STUB set#688
TomasVotruba merged 1 commit into
mainfrom
extract-mock-to-stub-set

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Extracts the 4 createMock()createStub() rules out of the PHPUnit 12.0 set into a standalone, reusable set.

New set

PHPUnitSetList::PHPUNIT_MOCK_TO_STUBconfig/sets/phpunit-mock-to-stub.php:

  • CreateStubOverCreateMockArgRector
  • CreateStubInCoalesceArgRector
  • ExpressionCreateMockToCreateStubRector
  • PropertyCreateMockToCreateStubRector

No breaking change

phpunit120.php now references the new set via PHPUNIT_MOCK_TO_STUB, so existing PHPUnit 12.0 users keep identical behavior, while the mock→stub migration can also be run on its own.

@TomasVotruba TomasVotruba merged commit 2f1c4bc into main Jun 29, 2026
8 checks passed
@TomasVotruba TomasVotruba deleted the extract-mock-to-stub-set branch June 29, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant