Skip to content

chore/bump mockery floor to ^1.3 for PHPUnit 8 compat#20

Merged
rick-lam merged 1 commit into
mainfrom
chore/bump-mockery-floor
May 7, 2026
Merged

chore/bump mockery floor to ^1.3 for PHPUnit 8 compat#20
rick-lam merged 1 commit into
mainfrom
chore/bump-mockery-floor

Conversation

@rick-lam
Copy link
Copy Markdown
Contributor

@rick-lam rick-lam commented May 7, 2026

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

  • `composer.json`: `"mockery/mockery": "^1"` -> `"mockery/mockery": "^1.3"`.

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

  • CI on this PR: 6 jobs (PHP 7.2/7.3/7.4 x prefer_lowest yes/no) + Markdown should all stay green against phpunit 7.x + mockery 1.3.0.
  • Once merged, Dependabot's PR Bump phpunit/phpunit from 7.3.1 to 8.5.52 #14 rebased onto main should pass all 6 PHP jobs.

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>
Copilot AI review requested due to automatic review settings May 7, 2026 10:50
@rick-lam rick-lam merged commit c27a8c4 into main May 7, 2026
9 checks passed
@rick-lam rick-lam deleted the chore/bump-mockery-floor branch May 7, 2026 10:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/mockery constraint from ^1 to ^1.3 to avoid resolving Mockery 1.0.x under --prefer-lowest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread composer.json
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>
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.

2 participants