Skip to content

Compatibility with PHPUnit 10, 11, 12, 13 and PHP 8.1-8.4#269

Open
unfulvio wants to merge 16 commits into
trunkfrom
feature/phpunit-9-13-compatibility
Open

Compatibility with PHPUnit 10, 11, 12, 13 and PHP 8.1-8.4#269
unfulvio wants to merge 16 commits into
trunkfrom
feature/phpunit-9-13-compatibility

Conversation

@unfulvio

@unfulvio unfulvio commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Modernizes WP_Mock's test harness for current PHPUnit and assumes this will be a 2.0.0 major release. The supported floor moves to PHP 8.1 + PHPUnit 10, and the library runs on PHPUnit 10, 11, 12 and 13 from a single codebase — Composer installs the highest PHPUnit your PHP allows (8.1 → 10 … 8.4 → 13). The public assertion API is unchanged.

Per review feedback on the original 9–13 approach: rather than bridge PHPUnit 9 with dual annotation+attribute metadata, 2.0 is a clean modern major and support for PHPUnit 9 is dropped. Since v10 requires 8.1, PHP 7.4/8.0 and PHPUnit 9 users must stay on the 1.x line, which continues to work as usual.

What changed

  • Floor raised to PHP 8.1 / PHPUnit 10 in composer.json; PHPUnit 9 dropped.
  • Tests are attributes-only. Removed the dual @dataProvider / @runInSeparateProcess / @preserveGlobalState doc-annotations (the #[...] attributes already existed) and converted 152 method-level @covers to class-level #[CoversClass]. Doc-comment metadata stopped working in PHPUnit 12, so this is required for 12/13, not cosmetic.
  • Deprecation reporting uses trigger_error(E_USER_DEPRECATED) (PHPUnit's TestResult/RiskyTestError were removed in 10); set failOnDeprecation="true" to fail on them.
  • Output assertions: PHPUnit 10 removed setOutputCallback() and made expectOutputString() final, so the implicit @stripTabsAndNewlinesFromOutput stripping is replaced by TestCase::assertOutputEqualsHtml($expectedHtml, $callback).
  • IsEqualHtml reworked onto matches()/toString() (single-arg constructor; $other now typed mixed).
  • Dropped the abandoned sempro/phpunit-pretty-print; removed the now-unused direct sebastian/comparator dev dependency (PHPUnit pulls it transitively); bumped mockery and PHPStan tooling to ^2.
  • Fixed WP_Mock::expectFilterNotAdded() defaulting $args to 10 instead of 1, so the "not added" expectation never matched a standard add_filter() call (note: consider backporting this change in the 1.x branch for the v1.1.1 untagged release).

A deliberate exception to the #[CoversClass] conversion: the two trait tests and the global-function-mock test are left without coverage metadata. #[CoversTrait] requires PHPUnit 11+ (above the floor), and #[CoversFunction] pointing at conditionally-defined global mocks is fragile under failOnWarning. They contribute whole-suite coverage instead, and each carries a one-line comment explaining why.

CI

  • Matrix trimmed to the supported range: PHP 8.1 → PU10, 8.2 → PU11, 8.3 → PU12, 8.4 → PU13 — dropping the old 7.4, 8.0 since the min is now 8.1. Each leg composer updates to the highest PHPUnit its PHP allows (a single committed lock can't satisfy every PHP/PHPUnit pair).
  • One --prefer-lowest leg (now PHP 8.1) keeps the declared dependency floors honest.
  • Coverage is measured on the 8.1 / PHPUnit 10 leg — flagged with a coverage: true matrix entry — with a single Coveralls upload, replacing the old 8.0/PU9 leg.

Upgrading

composer require --dev 10up/wp_mock:^2.0

Requires PHP 8.1+ and PHPUnit 10+. Two behavior changes (see UPGRADE.md):

  • Deprecated WP_Mock calls now surface as PHPUnit deprecations (failOnDeprecation) rather than marking tests "risky".
  • Use assertOutputEqualsHtml() where you relied on automatic output whitespace-stripping.

Behat

Left mostly untouched — it hadn't been properly run since ~1.0.0 (a parse error; it isn't wired into CI), now restored to passing with minimal fixes. I think Behat should either be dropped since this package is no longer using it consistently or brought up to parity with current phpunit tests. Either way this should be work for a follow up PR since the scope is quite large then.

Release suggestion before/after merging

I see you have an unreleased v1.1.1 despite this PR #263 -- I think you could tag v1.1.1 first as the last/current v1.x branch. Actually, you could consider backporting this fix to it as well (see changelog notes above):

  • Fixed WP_Mock::expectFilterNotAdded() defaulting $args to 10 instead of 1, so the "not added" expectation never matched a standard add_filter() call

After that's done, tag v1.1.1. Then, merge this branch and tag 2.0.0 if tests go well on your end.

unfulvio and others added 12 commits June 23, 2026 16:47
- Widen phpunit/phpunit to "^9.6 || ^10 || ^11 || ^12 || ^13"; php to ">=7.4"
- Remove config.platform.php pin (it forced PHPUnit 9 and blocked testing 10+)
- Bump mockery to ^1.6.12, phpstan trio to ^2, phpcs installer to ^1.0
- Drop abandoned sempro/phpunit-pretty-print; use --testdox
- Relax sebastian/comparator to a floor (>=4.0.8) so it never caps newer PHPUnit
- Split phpunit.xml into phpunit.xml.dist (modern 10+) and phpunit9.xml.dist (9.x)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
- Override matches()+toString() instead of evaluate() (stable across PHPUnit 9–13)
- Single-arg constructor (delta/canonicalize/ignoreCase were always defaults)
- Avoid Constraint::exporter() (removed in PHPUnit 11) — render message directly
- Preserve the existing "html is equal to '...'" failure-message format
- Dual-declare #[CoversClass]/#[DataProvider]; make data provider static (PHPUnit 10+)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
…tion listener

BREAKING (internal/behavioral):
- DeprecatedMethodListener now emits E_USER_DEPRECATED via trigger_error() instead of
  injecting a RiskyTestError into a TestResult. Removes setTestResult/setTestCase/checkCalls
  (TestResult + RiskyTestError were removed in PHPUnit 10). A deprecated call now surfaces as a
  deprecation (fails the suite under failOnDeprecation / convertDeprecationsToExceptions).
- TestCase::run() override removed (existed only to wire the listener to TestResult).
- Content-filtering magic removed: setUpContentFiltering(), the expectOutputString() override,
  setOutputCallback() (removed in PHPUnit 10), expectOutputString() became final in 10,
  the @stripTabsAndNewlinesFromOutput annotation, stripTabsAndNewlines(), $__contentFilterCallback.
  Replaced by an explicit, cross-version helper: assertOutputEqualsHtml(string, callable).
- setUp()/tearDown() retained; Util\Test::parseTestMethodAnnotations()/getName() no longer used.

Tests: rewrite DeprecatedMethodListenerTest (capture E_USER_DEPRECATED) and TestCaseTest
(createPartialMock instead of removed getMockForAbstractClass; dual annotation+attribute;
static data providers). Green on PHPUnit 9.6 (full suite) and 13 (these files).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
Doc-comment metadata is removed in PHPUnit 12 and data providers must be static in 10+.
Keep existing annotations (for the PHPUnit 9 / PHP 7.4 legs) and add equivalent single-line
attributes (#[DataProvider], #[RunInSeparateProcess], #[PreserveGlobalState(false)]) for 12+.

- Make all data provider methods static (#[DataProvider]); annotations retained.
- Add process-isolation attributes alongside @runInSeparateProcess/@preserveGlobalState.
- Replace getMockForAbstractClass (removed in 12) with createPartialMock; HookTest lists Hook's
  abstract methods so the generated double is concrete. MockWordPressObjectsTraitTest replaces
  getMockForTrait (also removed) with an anonymous class using the trait.
- Integration test: add cross-version isRunningInIsolation() shim to WP_MockTestCase (PHPUnit's
  isInIsolation() was removed in 10); convert $defaultMockedFunctions to a const so its data
  provider can be static.

Verified green: PHPUnit 9.6, 11, 12, 13 (PHP 8.4). On PHPUnit 11, non-failing doc-comment
metadata deprecation notices are emitted because annotations are retained for PHPUnit 9 support.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
- IsEqualHtml::matches(): cast only scalars to string (avoids cast.string on mixed under level max)
- Regenerate phpstan-baseline.neon for phpstan ^2 (analyzed against PHPUnit 13). Pre-existing
  level-max suppressions + test-doc-strictness; no new library bugs.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
- CI matrix: 7.4→9, 7.4→9 (prefer-lowest), 8.0→9, 8.1→10, 8.2→11, 8.3→12, 8.4→13.
  Each leg runs `composer update` (a single lock can't satisfy every PHP/PHPUnit pair) and
  selects phpunit9.xml.dist (9.x) or phpunit.xml.dist (10+). Coverage uploaded from the 8.4 leg.
- phpstan + php-compatibility jobs pinned to PHP 8.4 (phpstan analyzed against PHPUnit 13).
- phpcs.xml testVersion 7.4 -> 7.4- so PHPCompatibility checks the whole 7.4+ range.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
…0 upgrade

- installation.md: PHPUnit ^9.6 || ^10 || ^11 || ^12 || ^13, mockery ^1.6.12, and a note that
  Composer installs the highest PHPUnit your PHP allows
- wp-mock-test-case.md: replace the removed expectOutputString() override docs with
  assertOutputEqualsHtml(), plus a "Changed in 2.0.0" note
- CHANGELOG.md: 2.0.0 entry
- UPGRADE.md: 1.x -> 2.0 guide (PHP floor unchanged; the two behavior changes + migrations)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
Behat could not even parse since a deprecated step was added, so it never ran in CI
(CI runs phpunit only). Three pre-existing issues fixed:
- FunctionsContext: missing semicolon (parse error) in the deprecated iExcpectWhenIRun()
- FunctionsContext: remove the duplicate @then on iExcpectWhenIRun() (the same step is defined
  by iExpectWhenIRun()); keep the deprecated alias as a plain method
- FeatureContext: use the two-arg ReflectionProperty::setValue(null, $value) for the static
  __strict_mode property (single-arg form is deprecated since PHP 8.3)

Behat: 40 scenarios / 118 steps passing.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
…ds the hook

expectHookNotAdded() registers a shouldNotReceive expectation `->with($callback, $priority,
$args)`. expectFilterNotAdded() defaulted $args to 10 (a copy of the priority value) while every
sibling uses 1, so a standard add_filter() (1 accepted arg) never matched the guard and the
"not added" expectation silently passed. Caught by the now-restored Behat scenario
"expectFilterNotAdded fails when filter added".

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
Keep the Coveralls integration unchanged for the eventual merge to origin: one upload,
gated to the PHP 8.1 leg (matching origin's `env.PHP_VERSION == '8.1'`), same token and
command. Only that leg generates coverage; the other matrix legs just run tests. Coverage
numbers are leg-independent (all 175 tests run on every leg).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
phpstan ^1 cannot coexist with the modern toolchain (composer/pcre 3.4.0 conflicts with
phpstan 1.x on PHP 8.4), so phpstan ^2 is required. To stop the migration from padding the
baseline:
- Declare PHPUnit's mock-creation exceptions (MockObject\Exception, InvalidArgumentException)
  as uncheckedExceptionClasses — they are test-runner infrastructure, not exceptions a test
  documents in @throws.
- Relax getDeprecatedMethodCalls() return type; guard a non-empty-string assertion.

Baseline entries in files this PR changes: 14 -> 1 (the remaining one is a pre-existing
WP_MOCK_INCLUDE_DIR concat in untouched requireFileDependencies()). The net baseline change
(79 -> 126) is phpstan v2 surfacing pre-existing issues in library code the PR never touches.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
@unfulvio unfulvio self-assigned this Jun 23, 2026
@unfulvio unfulvio added Enhancement New feature proposal or pull request Tests Updates to tests PHPUnit Items pertaining PHPUnit php Pull requests that update php code labels Jun 23, 2026
@unfulvio unfulvio added this to the v2.0.0 milestone Jun 23, 2026
…refer-lowest

Two failures surfaced by the PR's CI matrix:

- testCanHandleDeprecatedMethodCallThroughWpMock failed on PHP <= 8.1 (the PHPUnit 9 and 10 legs):
  an anonymous class name embeds a null byte, which trigger_error() truncates, dropping the method
  name from the captured deprecation message (PHP 8.2+ stringifies anonymous classes differently,
  so 8.2/8.3/8.4 passed). Replaced the anonymous fixture with a named class
  (WpMockWithDeprecatedMethod) whose __METHOD__ is stable and null-byte-free on every PHP version.

- The prefer-lowest leg fatal-errored inside patchwork 2.1.0 (references a nonexistent
  PHPUnit\TextUI\TestSuiteObject). Raised antecedent/patchwork to ^2.1.27 — the version origin
  already ships in its lock, verified free of that reference.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
@coveralls

coveralls commented Jun 23, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 70.899% (+4.8%) from 66.142% — feature/phpunit-9-13-compatibility into trunk

origin measured Coveralls coverage on the PHP 8.1 leg, which there ran PHPUnit 9. In this branch
8.1 runs PHPUnit 10, and PHPUnit 10 reports less coverage than 9 for the process-isolated
(@runInSeparateProcess) tests that exercise much of WP_Mock.php — which showed up as a false
~7% coverage "decrease" on the PR. Move the single coverage upload to the PHP 8.0 leg (PHPUnit 9,
phpunit9.xml.dist), matching origin's coverage engine and config so the number is comparable.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
@unfulvio

unfulvio commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator Author

hey @ajaynes-godaddy @agibson-godaddy @nmolham-godaddy @wvega-godaddy @rneudorf-godaddy how have you been?

I hope you are still using this library at GD and I remember even back then we were trying to add support to phpunit 10... now even that has been sunset / EOL -- so I tried to give it a pass with Claude to see what would it take to level up compatibility.

I don't have a large codebase as you probably do to try this with... Let me know what you think, or if a v2 branch can be merged alongside the current v1 (by the way I think you have an unreleased 1.1.1).

Cheers

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates WP_Mock to support PHPUnit 9.6 through 13 (and PHP 7.4–8.4) from a single codebase, including internal behavioral changes around deprecation reporting and output assertions, plus aligned test/CI/tooling updates for cross-version compatibility.

Changes:

  • Replaces deprecated-call “risky test” reporting with native E_USER_DEPRECATED notices and updates tests accordingly.
  • Reworks HTML/output assertions for PHPUnit 10+ compatibility by introducing TestCase::assertOutputEqualsHtml() and refactoring IsEqualHtml.
  • Expands CI/test configuration and tooling (dual annotations/attributes, phpunit config split, updated composer/phpstan/phpcs settings) to run across the full supported PHP/PHPUnit matrix.

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
UPGRADE.md Adds upgrade guidance for 1.x → 2.0 behavior changes and configuration notes.
tests/WP_MockTestCase.php Adds a cross-version helper to detect process isolation (PHPUnit 9 vs 10+).
tests/Unit/WP_MockTest.php Updates unit tests to use PHPUnit attributes and static data providers where required.
tests/Unit/WP_Mock/Traits/MockWordPressObjectsTraitTest.php Replaces trait mocking approach for compatibility with newer PHPUnit mocking behavior.
tests/Unit/WP_Mock/Tools/TestCaseTest.php Updates tests to reflect removed internals and the new output assertion helper.
tests/Unit/WP_Mock/Tools/Constraints/IsEqualHtmlTest.php Aligns constraint tests with the refactored IsEqualHtml API.
tests/Unit/WP_Mock/Matcher/FuzzyObjectTest.php Migrates data providers to attributes/static providers for PHPUnit 10+.
tests/Unit/WP_Mock/HookTest.php Updates tests to use attributes/static providers and partial mocks.
tests/Unit/WP_Mock/FunctionsTest.php Adds attributes/static providers and isolation where needed for global-function mocking.
tests/Unit/WP_Mock/Functions/HandlerTest.php Runs key tests in separate processes to avoid global-state bleed.
tests/Unit/WP_Mock/DeprecatedMethodListenerTest.php Reworks tests to validate E_USER_DEPRECATED behavior and message formatting.
tests/Unit/WP_Mock/API/FunctionMocksTest.php Adds process isolation attributes for function-mock integration behavior.
tests/Integration/WP_MockTest.php Updates integration tests for isolation detection and static providers/constants.
phpunit9.xml.dist Removes abandoned pretty-printer configuration for PHPUnit 9 runs.
phpunit.xml.dist Adds PHPUnit 10+ configuration (including deprecation handling) and test suites/source includes.
phpstan.neon Tunes PHPStan checked-exception handling for PHPUnit mock infrastructure exceptions.
phpstan-baseline.neon Refreshes baseline format/identifiers and updates ignored error patterns.
phpcs.xml Updates PHPCompatibility testVersion range configuration.
php/WP_Mock/Tools/TestCase.php Removes PHPUnit 10-incompatible overrides and introduces assertOutputEqualsHtml().
php/WP_Mock/Tools/Constraints/IsEqualHtml.php Refactors constraint to matches()/toString() and single-arg constructor.
php/WP_Mock/DeprecatedMethodListener.php Switches deprecated-call signaling to trigger_error(E_USER_DEPRECATED) and removes removed-PHPUnit-API dependencies.
php/WP_Mock.php Fixes expectFilterNotAdded() default $args from 10 to 1.
features/bootstrap/FunctionsContext.php Fixes deprecated Behat step wrapper and corrects implementation call.
features/bootstrap/FeatureContext.php Updates ReflectionProperty::setValue() usage for PHP 8.3 deprecation.
docs/tools/wp-mock-test-case.md Documents the new assertOutputEqualsHtml() helper and the 2.0 change rationale.
docs/general/installation.md Updates dependency documentation for PHPUnit 9–13 and Mockery floor.
composer.json Broadens PHPUnit constraints, bumps dependency floors, updates tooling versions, and adjusts test scripts.
CHANGELOG.md Adds 2.0.0 entry describing compatibility work and breaking internal behavior changes.
.github/workflows/ci.yml Expands CI matrix (PHP 7.4–8.4), switches to per-leg composer update, adds prefer-lowest leg, and splits phpunit configs.
Comments suppressed due to low confidence (1)

tests/Integration/WP_MockTest.php:55

  • This override of setUp() doesn't call parent::setUp(), so the base WP_MockTestCase setup (including its Mockery reset/cleanup) is skipped for this entire test class. That can cause test-order-dependent failures or leaking Mockery state between tests.
    protected function setUp(): void
    {
        if (! $this->isRunningInIsolation()) {
            WP_Mock::setUp();
        }

        require_once(dirname(__DIR__).'/Mocks/Functions.php');
    }

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

Comment thread tests/Unit/WP_Mock/DeprecatedMethodListenerTest.php Outdated
@agibson-godaddy

Copy link
Copy Markdown
Contributor

Hi @unfulvio ! Thanks for taking a stab at this. Wondering what we think about just dropping PHPUnit 9 if we're doing a major version anyway?

@unfulvio

Copy link
Copy Markdown
Collaborator Author

hey @agibson-godaddy sure up to you, makes sense too, I can take another pass removing 9.x support. WooCommerce itself still supports 9.x - not sure of the limitations in the stack though, could be something I have missed. On your end, does running this on the MWC packages or SV plugins does it work out of the box?

@agibson-godaddy

Copy link
Copy Markdown
Contributor

@unfulvio I think I figure if someone still needs PHPUnit 9 they could just not upgrade to future v2. Not really any harm in hanging back!

I haven't had a chance to test this yet but I'll see if I can carve out time later this week!

Per maintainer feedback, scope WP_Mock 2.0 as a clean modern major rather than a
9-13 bridge. The floor is now PHP 8.1 + PHPUnit 10; the supported range is PHPUnit
10, 11, 12 and 13 from one codebase. PHP 7.4/8.0 and PHPUnit 9 users stay on 1.x.

This lets the harness shed every 9.x compatibility shim:

- Tests are attributes-only: removed the dual @dataProvider / @runInSeparateProcess /
  @preserveGlobalState doc-annotations (the #[...] attributes already existed) and
  converted 152 method-level @Covers to class-level #[CoversClass]. The two trait
  tests and the global-function-mock test are intentionally bare (#[CoversTrait]
  needs PHPUnit 11+, above the floor; #[CoversFunction] on conditionally-defined
  global mocks is fragile under failOnWarning).
- Deleted phpunit9.xml.dist; phpunit.xml.dist is the only runner config.
- Dropped the dead PHPUnit 9 branch from WP_MockTestCase::isRunningInIsolation().
- Removed the now-unused direct sebastian/comparator dev dependency (PHPUnit pulls
  it transitively).
- IsEqualHtml::matches() now types $other as mixed (PHP 8.1 floor).

CI matrix drops the 7.4, 8.0 and 7.4-prefer-lowest legs; it now runs 8.1 -> PU10
(coverage), 8.2 -> PU11, 8.3 -> PU12, 8.4 -> PU13, plus an 8.1 prefer-lowest leg.
The single Coveralls upload moves to the 8.1/PU10 leg.

Docs (README, installation, CHANGELOG, UPGRADE) lead with the PHP 8.1 / PHPUnit 10
floor as the headline breaking change.

Local: 175 tests pass on PHPUnit 13 with failOnDeprecation on; PHPStan clean
(baseline unchanged); phpcs clean (8.1+); Behat 40/40.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
@unfulvio unfulvio changed the title Compatibility with PHPUnit 9, 10, 11, 12, 13 and PHP 7.4-8.4 Compatibility with PHPUnit 10, 11, 12, 13 and PHP 8.1-8.4 Jun 24, 2026
Address review feedback: the helper reads DeprecatedMethodListener::$deprecatedCalls
(typed array<array{string, array<mixed>}>) but declared the broad array<mixed>. Mirror
the source shape so the [$method, $args] pairs are clear at call sites and static
analysis stays useful. The reflected value is narrowed with a @var (it arrives as
mixed from ReflectionProperty::getValue()), so PHPStan level-max stays clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01K8HGMxCuSjUX6p4PQL7t5Y
@unfulvio

Copy link
Copy Markdown
Collaborator Author

hey @agibson-godaddy here's another pass -- phpunit v9.x support dropped, test coverage from coveralls increased as a result 🙃

some suggestions for release path:

I see you have an unreleased v1.1.1 despite this PR #263 -- I think you could tag v1.1.1 first as the last/current v1.x branch. Actually, you could consider backporting this fix to it as well (best done it in separate PR, I can also open that after this PR is ready to go from your end):

  • Fixed WP_Mock::expectFilterNotAdded() defaulting $args to 10 instead of 1, so the "not added" expectation never matched a standard add_filter() call

After that's done, tag v1.1.1. Then, merge this branch and tag 2.0.0 if tests go well on your end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature proposal or pull request php Pull requests that update php code PHPUnit Items pertaining PHPUnit Tests Updates to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants