Skip to content

Support Forums: Fix the review edit lock test under PHPUnit 11 - #1093

Closed
bor0 wants to merge 1 commit into
WordPress:trunkfrom
bor0:fix/support-forums-tests-phpunit-11
Closed

bor0 wants to merge 1 commit into
WordPress:trunkfrom
bor0:fix/support-forums-tests-phpunit-11

Conversation

@bor0

@bor0 bor0 commented Oct 22, 2026

Copy link
Copy Markdown
Member

The WP: Support Forums unit test job fails on trunk (scheduled run 39714665029) and on every PR that touches the plugin:

1) Review_Edit_Lock_Test::test_only_author_can_edit_old_review_topic_from_directory_view
Error: Call to undefined method PHPUnit\Util\Test::parseTestMethodAnnotations()

/wordpress-phpunit/includes/abstract-testcase.php:642

Cause

Review_Edit_Lock_Test, added in 8948820, extends Core's WP_UnitTestCase. Core's expectDeprecated() reads annotations with getAnnotations() when that method exists and otherwise falls back to PHPUnit\Util\Test::parseTestMethodAnnotations(). PHPUnit 10 removed the fallback, and the test environments install PHPUnit 11.

Fix

Give the test an empty getAnnotations(), matching wporg-gp-translation-events/tests/class-base-test.php. The test uses no @expectedDeprecated / @expectedIncorrectUsage annotations, so an empty set is equivalent.

Testing

  • php -l and PHPCS pass.
  • Relying on CI for the suite itself; wp-env start for the test environment didn't finish locally.

🤖 Generated with Claude Code

Core's `expectDeprecated()` falls back to `PHPUnit\Util\Test::parseTestMethodAnnotations()` when `getAnnotations()` is missing, and PHPUnit 10 removed it, so the test errored before running. Provide an empty `getAnnotations()`, as the Translation Events tests do.

Follow-up to [8948820].

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props bor0.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 46 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 28d14ace-28ac-40bb-9c1f-96ee89265f38
📥 Commits

Reviewing files that changed from the base of the PR and between cd6275d and 8775c50.

📒 Files selected for processing: 1
  • wordpress.org/public_html/wp-content/plugins/support-forums/tests/Review_Edit_Lock_Test.php
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bor0
bor0 deleted the fix/support-forums-tests-phpunit-11 branch October 22, 2026 19:09
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.

1 participant