Add behat test for config has after concatenation assignment#220
Add behat test for config has after concatenation assignment#220pwtyler wants to merge 4 commits intowp-cli:mainfrom
Conversation
|
Hello! 👋 Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project. Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. Here are some useful Composer commands to get you started:
To run a single Behat test, you can use the following command: # Run all tests in a single file
composer behat features/some-feature.feature
# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123You can find a list of all available Behat steps in our handbook. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new test scenario to verify that the wp config has command correctly identifies variables and constants when they follow a concatenation assignment. A review comment points out that the wp-config.php content in the test is missing the required <?php opening tag, which is necessary for the PHP parser to correctly process the file and for the test to function as intended.
wp-cli/wp-config-transformer#64 is merged but not yet released. Using the VCS source + dev-main so CI can run against the fixed code. Will revert to a version constraint once a release is cut.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Expands test coverage to mirror the edge cases in the transformer's own ConcatenationTest: concatenation expressions, variables after concatenation, multiline string values, and multiline raw expressions (array defines, multi-line concatenation).
Summary
config-has.featurethat verifieswp config hasfinds variables and constants when the wp-config.php contains a variable assignment with string concatenation (e.g.$x = 'foo' . $bar;)Depends on wp-cli/wp-config-transformer#64
Dependency note
wp-cli/wp-config-transformer#64 is now merged.
composer.jsontemporarily points atdev-mainvia a VCS repository entry so CI runs against the fixed code. Once a release ofwp-config-transformeris cut, this PR will be updated to pin to that version and therepositoriesoverride removed.