Skip to content

Modernize deprecated syntax in Behat tests#229

Merged
swissspidy merged 1 commit into
mainfrom
fix/modernize-deprecated-behat-syntax
Jul 23, 2026
Merged

Modernize deprecated syntax in Behat tests#229
swissspidy merged 1 commit into
mainfrom
fix/modernize-deprecated-behat-syntax

Conversation

@schlessera

@schlessera schlessera commented Jul 23, 2026

Copy link
Copy Markdown
Member

What

Updates the Behat tests to use the current command syntax instead of forms deprecated by wp-cli/wp-cli#6356.

Why

The framework now emits a deprecation warning to STDERR when it rewrites these legacy forms. This breaks When I run steps, which expect STDERR to remain empty.

Tests

  • composer test

Summary by CodeRabbit

  • Tests
    • Updated configuration creation coverage to verify that wp config create --skip-check reads database settings and additional PHP configuration from wp-cli.yml.
    • Confirmed generated wp-config.php includes the expected database values and post-revision setting.

WP-CLI now emits deprecation warnings when it rewrites legacy command syntax. Use the modern forms in the Behat scenarios so the standard run step can continue to require clean STDERR.
@schlessera schlessera added this to the 2.5.3 milestone Jul 23, 2026
@schlessera schlessera added command:config-create Related to 'config create' command scope:testing Related to testing labels Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 65a0ef3f-8749-4899-b1aa-b8a608b5a195

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/modernize-deprecated-behat-syntax

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

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@schlessera
schlessera marked this pull request as ready for review July 23, 2026 06:03
@schlessera
schlessera requested a review from a team as a code owner July 23, 2026 06:03
@github-actions github-actions Bot added the command:config Related to 'config' command label Jul 23, 2026

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
features/config-create.feature (1)

152-153: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert the configured WP_POST_REVISIONS value, not just its presence.

This currently passes if the constant exists with any value, so it would not detect a regression from 50. Use the Behat file-content assertion to verify the complete definition.

Proposed fix
-    When I run `grep WP_POST_REVISIONS wp-config.php`
-    Then STDOUT should not be empty
+    Then the wp-config.php file should contain:
+      """
+      define( 'WP_POST_REVISIONS', 50 );
+      """
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@features/config-create.feature` around lines 152 - 153, Update the
WP_POST_REVISIONS scenario in the feature to use the Behat file-content
assertion and verify the complete wp-config.php definition includes the expected
value 50, rather than only asserting grep output is non-empty.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@features/config-create.feature`:
- Around line 152-153: Update the WP_POST_REVISIONS scenario in the feature to
use the Behat file-content assertion and verify the complete wp-config.php
definition includes the expected value 50, rather than only asserting grep
output is non-empty.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d05c75e8-14d0-4244-a607-a0e6a71f645b

📥 Commits

Reviewing files that changed from the base of the PR and between 00055f5 and 41b6a60.

📒 Files selected for processing (1)
  • features/config-create.feature

@swissspidy
swissspidy merged commit 69b3dbe into main Jul 23, 2026
69 of 70 checks passed
@swissspidy
swissspidy deleted the fix/modernize-deprecated-behat-syntax branch July 23, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:config Related to 'config' command command:config-create Related to 'config create' command scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants