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 installThen you can run a local WordPress instance with the plugin installed:
composer dev:startOnce the environment is running, you must create the database tables needed by this plugin:
composer dev:db:schemaWordPress 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.sqlYou can run tests in wp-env with the following command:
Note that
wp-envmust be running.
composer dev:testIf you want to run only one test, you can use the following command:
composer dev:test -- --filter methods_name