Modernize deprecated syntax in Behat tests#229
Conversation
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.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
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 winAssert the configured
WP_POST_REVISIONSvalue, 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
📒 Files selected for processing (1)
features/config-create.feature
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 runsteps, which expect STDERR to remain empty.Tests
composer testSummary by CodeRabbit
wp config create --skip-checkreads database settings and additional PHP configuration fromwp-cli.yml.wp-config.phpincludes the expected database values and post-revision setting.