a starter for applying TDD in wordpress plugin development
php 7.3.11 + docker compose + wordpress
-
start wordpress docker instance:
docker compose up -d
-
setup wordpress by access
http://localhost
in your browser -
open a new terminal and run:
docker exec -it eric-wp-mt_1 /bin/bash
-
inside docker instance then run :
sh init.sh
ps: if you already have bootstrap.php , then replace it
-
when it finished, run :
cd ./wp-content/plugins/my-test-plugin
-
Assume db ( a new db just for testing ) names wordpress_test_db_2:
bin/install-wp-tests.sh wordpress_test_db_2 root 'ChangeMeIfYouWant' mysql
If finished without error , All Done.