Skip to content

Streamline testing WordPress plugins and themes using the WordPress core test framework

License

Notifications You must be signed in to change notification settings

assertwell/wp-core-test-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WP Core Test Framework

License: MIT Contributor Covenant

This package helps reduce duplication across WordPress plugins and themes by enabling common test scaffolding to be provided via Composer.

Installation

To install the WordPress core test framework into your plugin or theme, install this package as a Composer dependency:

$ composer require --dev assertwell/wp-core-test-framework

Usage

Replacing the default bin/install-wp-tests.sh file

When scaffolding a new WordPress plugin or theme via WP-CLI, the generator will create a shell script at bin/install-wp-tests.sh.

This file is meant to create an instance of the WordPress core development repository, which includes the WordPress core testing framework.

In many cases, this shell script is never modified, and is often the only file present in the bin/ directory. Rather than copying and pasting this file across a bunch of repositories, install-wp-tests.sh is provided as a vendor binary by this package.

To use it, find anywhere you're currently (or would be) referencing bin/install-wp-tests.sh and replace it with vendor/bin/install-wp-tests.sh.

# .travis.yml

  install:
      - composer install --prefer-dist --no-interaction
-     - bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
+     - bash vendor/bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION

If your project already contains a bin/install-wp-tests.sh file, you may delete it from your repository.

About

Streamline testing WordPress plugins and themes using the WordPress core test framework

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages