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 updates the super-admin.feature test file to use wp eval-file with a temporary PHP script instead of an inline wp eval command for user deletion. The review feedback suggests adopting short array syntax [] in the PHP script to comply with modern PHP coding standards.
| """ | ||
| <?php | ||
| global $wpdb; | ||
| $wpdb->delete( $wpdb->users, array( 'user_login' => 'admin2' ) ); |
There was a problem hiding this comment.
To align with modern PHP standards (PSR-12) and for consistency within the project, please use the short array syntax [] instead of array().
$wpdb->delete( $wpdb->users, [ 'user_login' => 'admin2' ] );
References
- The PSR-12 standard is the current recommendation for PHP code style. While it doesn't explicitly forbid
array(), the use of short array syntax ([]) is a widely adopted best practice in the modern PHP ecosystem and is often enforced by linters configured for PSR-12. (link)
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.
Pull request overview
Updates the super-admin Behat feature test to avoid inline wp eval quoting issues that can break on Windows shells.
Changes:
- Replace inline
wp evaluser deletion with a temporary PHP script +wp eval-file.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $wpdb->delete( $wpdb->users, array( 'user_login' => 'admin2' ) ); | ||
| """ | ||
| When I run `wp eval-file delete-user.php` | ||
| And I run `wp eval 'wp_cache_flush();'` |
There was a problem hiding this comment.
This step still uses wp eval 'wp_cache_flush();', which relies on single-quote shell parsing and can still fail under Windows shells (cmd.exe/PowerShell). Consider replacing this with a shell-friendly command like wp cache flush (or include the cache flush in the same eval-file script) to fully address Windows compatibility.
| And I run `wp eval 'wp_cache_flush();'` | |
| And I run `wp cache flush` |
No description provided.