Here we are implementing Translation Events, as discussed in our Polyglots Make P2 Post: Translation Events Prototype.
First follow instructions to install wp-env
.
Then install dependencies:
composer install
Then you can run a local WordPress instance with the plugin installed:
composer dev:start
Once the environment is running, you must create the database tables needed by this plugin:
composer dev:db:schema
WordPress is now running at http://localhost:8888, user: admin
, password: password
.
If you are not using wp-env
, you need to add the tables to the database of your local environment. To do this, you can run this command from the plugin folder:
wp db query < schema.sql
You can run tests in wp-env
with the following command:
Note that
wp-env
must be running.
composer dev:test
If you want to run only one test, you can use the following command:
composer dev:test -- --filter methods_name