(WP-CLI) Wordpress-Tests_Lib files not being created (WP-CLI) Wordpress-Tests_Lib files not being created wordpress wordpress

(WP-CLI) Wordpress-Tests_Lib files not being created


I had this problem and here is what you might try:

  1. Confirm that /tmp/wordpress-tests-lib is missing the includes directory.

  2. Confirm that you have svn installed on the machine. If not run sudo apt-get install subversion

  3. Delete the /tmp/wordpress-tests-lib folder

  4. Inside your plugin directory open up the bin/install-wp-tests.sh file and remove the quiet flag on the Subversion call. Change this line:

    svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includestosvn co https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
  5. Run the install shell script command again.

You should now be able to run PHPUnit and see the one default test passes.


I was having the same issue; resolved it by following the instructions here: https://github.com/wp-cli/wp-cli/wiki/Plugin-Unit-Tests . Specifically, I needed to initialize the testing environment.

bash bin/install-wp-tests.sh wordpress_test root '' localhost latest

where wordpress_test is test database, root is DB user and '' contains password.

Further Resources: