A command line interface for WordPress

Commands » scaffold » plugin-tests

wp scaffold plugin-tests - Generate files needed for running PHPUnit tests in a plugin.

Quick links: Github issues

The following files are generated by default:

Learn more from the plugin unit tests documentation.


The tests/bootstrap.php file looks for the WP_TESTS_DIR environment variable.


The name of the plugin to generate test files for.
Generate test files for a non-standard plugin path. If no plugin slug is specified, the directory name is used.
Choose a configuration file for a continuous integration provider. -– default: travis options:
  • travis
  • circle
    • gitlab -–
Overwrite files that already exist.


# Generate unit test files for plugin 'sample-plugin'.
$ wp scaffold plugin-tests sample-plugin
Success: Created test files.