feat(bridge-rector)!: split mock conversions into PHPUnit→Double, PHPUnit→Mockery and Mockery→Double sets - #351
Merged
Merged
Conversation
…Unit→Mockery and Mockery→Double sets feat(bridge-rector): convert PHPUnit mocks onto Mockery feat(bridge-rector): convert Mockery doubles onto Double feat(bridge-rector): convert configured and partial mocks, `willReturnMap` and every PHPUnit constraint via predicates fix(bridge-rector): normalise type names Double's `Argument::type()` would read as classes fix(skills): let the Rector scaffolder take several sets and find them in the flattened `config/` docs(skills): document the mock sets BREAKING CHANGE: `phpunit-to-testo` no longer converts mocks, since the target library is a choice; add `TestoRectorSetList::PHPUNIT_TO_DOUBLE` or `PHPUNIT_TO_MOCKERY` next to it. `CreateMockToDoubleRector` moved to the `Testo\Bridge\Rector\PhpunitToDouble` namespace. Constraint predicates reproduce PHPUnit's own evaluate(); PhpunitConstraintTest pins verdicts taken from PHPUnit on the edge values. Assisted-By: Claude Opus 5.5
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Merged
roxblnfk
added a commit
that referenced
this pull request
Sep 25, 2026
…Unit→Mockery and Mockery→Double sets (#351) feat(bridge-rector): convert PHPUnit mocks onto Mockery feat(bridge-rector): convert Mockery doubles onto Double feat(bridge-rector): convert configured and partial mocks, `willReturnMap` and every PHPUnit constraint via predicates fix(bridge-rector): normalise type names Double's `Argument::type()` would read as classes BREAKING CHANGE: `phpunit-to-testo` no longer converts mocks, since the target library is a choice; add `TestoRectorSetList::PHPUNIT_TO_DOUBLE` or `PHPUNIT_TO_MOCKERY` next to it. `CreateMockToDoubleRector` moved to the `Testo\Bridge\Rector\PhpunitToDouble` namespace. Constraint predicates reproduce PHPUnit's own evaluate(); PhpunitConstraintTest pins verdicts taken from PHPUnit on the edge values. Assisted-By: Claude Opus 5.5
roxblnfk
added a commit
that referenced
this pull request
Sep 25, 2026
fix(skills): let the Rector scaffolder take several sets and find them in the flattened `config/` Assisted-By: Claude Opus 5.5
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🔍 What was changed
phpunit-to-testointo three sets, each with its own folder, config andTestoRectorSetListconstant:PHPUNIT_TO_DOUBLE,PHPUNIT_TO_MOCKERY,MOCKERY_TO_DOUBLE.CreateMockToMockeryRector(PHPUnit to Mockery),MockeryToDoubleRector(Mockery to Double, following Double's migration table) andMockeryIntegrationToDoubleRector(MockeryPHPUnitIntegration/MockeryTestCasetoVerifiesDoubles).willReturnMap, and every constraint without a dedicated matcher, as a predicate that reproduces PHPUnit's ownevaluate().isType('integer'),Mockery::type('integer')and similar produced a Double matcher that never matched, because Double'sArgument::type()reads any name outside its builtin list as a class.--setvalues, andprecheck.phpfinds the sets in the flattenedconfig/.Breaking changes
phpunit-to-testono longer converts mocks. AddPHPUNIT_TO_DOUBLEorPHPUNIT_TO_MOCKERYnext to it.CreateMockToDoubleRectormoved toTesto\Bridge\Rector\PhpunitToDouble.Review notes
Mockery::mock(X)becomesDouble::for(X)->strict(), since a plain Mockery mock throws on unconfigured calls, andshouldNotHaveBeenCalled()becomesreceived('__invoke')->never(), since Mockery's version only concerns__invoke, notunused().==, Double with===for scalars. Tests relying on coercion fail after conversion by design.Checklist
evaluate()over 56 constraints x 39 valuescomposer test:ci -- --type=!benchrun locally (only failure is the known local Xdebug nesting inBenchAttr::rangeSum)Documentation
FEATURE_PARITY.md, per-folderTODO.md, skillstesto-migrate-from-phpunitandtesto-test-doubles.