chore/bump mockery floor to ^1.3 for PHPUnit 8 compat#20
Merged
Conversation
Mockery added : void return-type overrides on its MockeryPHPUnitIntegration trait in 1.3.0 (2019) to match the return-type changes in PHPUnit 8. The current ^1 floor lets --prefer-lowest resolve mockery 1.0.x, which still has the return-typeless overrides and fatals when paired with PHPUnit 8 (observed on Dependabot PR #14's prefer-lowest jobs). Mockery ^1.3 supports PHP 5.6+ and PHPUnit 5.x/6.x/7.x/8.x, so this is non-breaking against the suite's currently-pinned phpunit ^5.7.21 | ^6 | ^7 constraint. No code changes required. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Bumps the minimum mockery/mockery version in require-dev to ensure --prefer-lowest can still resolve a Mockery release that is compatible with PHPUnit 8’s lifecycle hook return types.
Changes:
- Raise
mockery/mockeryconstraint from^1to^1.3to avoid resolving Mockery 1.0.x under--prefer-lowest.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
42
to
46
| "require-dev": { | ||
| "graze/standards": "^2.0", | ||
| "mockery/mockery": "^1", | ||
| "mockery/mockery": "^1.3", | ||
| "phpunit/phpunit": "^5.7.21 | ^6 | ^7", | ||
| "squizlabs/php_codesniffer": "^3.3.1" |
rick-lam
added a commit
that referenced
this pull request
May 7, 2026
Manual rebase of the Dependabot phpunit-8 bump onto main needed the lock refreshed: composer.json on main requires mockery ^1.3 since #20, but Dependabot's lock still pinned mockery 1.1.0. Ran `composer update mockery/mockery` locally to pick up 1.4.0, which has the : void overrides on MockeryPHPUnitIntegration that PHPUnit 8 expects. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Bump the `mockery/mockery` floor from `^1` to `^1.3` so `--prefer-lowest` resolves a phpunit-8-compatible mockery.
Root cause
Mockery added `: void` return-type overrides on its `MockeryPHPUnitIntegration` trait in 1.3.0 (2019), to match the return-type changes in PHPUnit 8. The current `^1` floor lets `--prefer-lowest` resolve mockery 1.0.x, which still has the return-typeless overrides and fatals when paired with PHPUnit 8:
```
PHP Fatal error: Declaration of Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration::assertPostConditions()
must be compatible with PHPUnit\Framework\TestCase::assertPostConditions(): void
```
Observed on the `(lowest)` rows of Dependabot PR #14's CI run after PR #19 landed the test-side `: void` fix on main: https://github.com/graze/sprout/actions/runs/25491075651
Notable changes
Mockery ^1.3 supports PHP 5.6+ and PHPUnit 5.x/6.x/7.x/8.x, so this is non-breaking against the suite's currently-pinned `phpunit ^5.7.21 | ^6 | ^7` constraint. No code changes.
QA