WordPress / create-block-theme

A WordPress plugin to create block themes
https://wordpress.org/plugins/create-block-theme/
GNU General Public License v2.0
310 stars 44 forks source link

Tests: use tests-wordpress wp-env for phpunit #618

Closed vcanales closed 1 month ago

vcanales commented 2 months ago

Running tests on the cli environment causes conflicts with the dev environment; the tests will log you out, modify the theme, etc.

Running tests on tests-wordpress will allow you to run tests along with the dev environment without interference.

Testing:

  1. Run npm run wp-env start to start a WordPress environment.
  2. Log into the dev environment and see that everything is working normally.
  3. Running npm run test:php will work as before, and will not mess with the dev environment. Before applying this branch, running npm run test:php would log you out and activate an invalid theme on your dev environment.