Skip to content

How to run PHPunit tests

Gregor Capuder edited this page Jul 20, 2020 · 1 revision

Prerequisite:

  • globally installed PHPUnit version 7
  • locally accessible MySQL database server
  • installed SVN (subversion)

Steps:

  1. in the plugin repo run: ./bin/install-wp-tests.sh <db-name> <db-user> <db-pass> [db-host] example: ./bin/install-wp-tests.sh ocdi_wp_phpunit_tests root root 127.0.0.1
  2. If not successful, read the error and resolve any missing dependencies
  3. in the plugin repo run: phpunit

This will run the PHPunit tests in the tests folder.

Clone this wiki locally