Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap WP CLI in PHPUnit environment #5524

Merged
merged 3 commits into from
Oct 19, 2020

Conversation

johnwatkins0
Copy link
Contributor

@johnwatkins0 johnwatkins0 commented Oct 19, 2020

Summary

Fixes #5523 by making WP CLI utility functions available in the PHPUnit environment. Currently, PR #5306 is failing with a fatal error due to a missing WP CLI utility function, and this will fix that.

To fix it, I created a bootstrap.php file inside tests/php and from there imported the wp-dev-lib bootstrap file along with WP CLI's own PHPUnit bootstrap file. As @schlessera suggested on Slack, I also added wp-cli/wp-cli as a dev dependency with Composer to make sure it's actually there.

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@johnwatkins0 johnwatkins0 marked this pull request as ready for review October 19, 2020 20:31
@github-actions
Copy link
Contributor

Plugin builds for 66a9fe2 are ready 🛎️!

@westonruter westonruter added this to the v2.1 milestone Oct 19, 2020
Copy link
Contributor

@pierlon pierlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me, :shipit:.

@westonruter westonruter merged commit 309eccb into develop Oct 19, 2020
@westonruter westonruter deleted the fix/5523-wp-cli-bootstrap-phpunit branch October 19, 2020 22:30
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.

WP CLI not bootstrapped in PHPUnit environment
3 participants