alaminopu / wp-test-skeleton

A basic skeleton for writing test for WordPress Plugins/Themes.
GNU General Public License v3.0
0 stars 0 forks source link

WP Test Skeleton

A basic skeleton for writing test for WordPress Plugins/Themes.

Installation

  1. Download or Clone this repo. Copy the tests folder and paste into Your plugin directory (Ex. /wp-content/plugins/myplugin/)

  2. Create a new database for test. (Ex. wpunittest)

  3. Go to the tests folder and Edit wp-tests-config.php file according to your preference.

  4. Install phpunit If you are using ubuntu/Linux Mint, you can type sudo apt-get install phpunit in your terminal to install phpunit.

Write Test

Inside the tests folder. Create your first test file. Make sure you prefix the file name with test. There is also an example file test-test.php in the test folder.

Running Test

Use your terminal and go to the test folder. Then type phpunit.