So I've managed to follow the instructions to get the "Plugin Integration Tests" set up using
wp-cli and the
install-wp-tests.sh script as described in the handbook article:
After much hassle and debugging of a million things, I even have an example test running, yay! It's possible! Don't give up!
My issue: The custom PHPUnit extensions for WP aren't picked up by my IDE.
/wordpress-tests-lib/directory is deep in the bowels of my Mac, where
install-wp-tests.shinstalled it along with the ghost copy of WP
- The code runs when I use the
phpunitcommand in the terminal because
- But because the testing library is nowhere near my WP directory or the plugin, VS Code (and probably any other IDE) doesn't pick it up, and my test ends up looking like this:
I can't use autocomplete or navigate to source and all those good things.
I can't be the only one with this problem! How do you deal with this?
I'm going to post my janky solution below, but am eager to hear how others make this work for themselves :)