Link7/advanced-site-creation — pull request #12 by ramalveyra (2014-02-13 04:16:27+00:00)
Title: Unit testing for Advanced Site Creation Plugin

This is in relation to #1.

This structure involves using PHPUnit extended with Wordpress Automated Testing http://make.wordpress.org/core/handbook/automated-testing/.

It is using the skeleton provided by https://github.com/tierra/wordpress-plugin-tests.

Doing the test locally
If you are using Varying-Vagrant-Vagrants as your local environment for Wordpress, then you use the builtin PHPUnit and Wordpress tests that are built out of the box.

Go to the VVV shell by doing ``` vagrant ssh ```.

Navigate through the **Wordpress Develop** plugins directory ```/vagrant/www/wordpress-develop/src/wp-content/plugins/```.

Copy or clone the plugin (containing the tests) within this directory.

Navigate through the plugin directory and run ```phpunit``` ```/vagrant/www/wordpress-develop/src/wp-content/plugins/advanced-site-creation/phpunit```.

You should be able to see the result of the test. Refer to http://make.wordpress.org/core/handbook/automated-testing/ for more details and reference for the test symbols.

Travis
This currently links to Travis, create the build and runs the test script. See .travis.yml for details of the build. It clones wordpress develop trunk, creates a test db, attach the plugin and runs the tests.

![image](https://f.cloud.github.com/assets/3870763/2144051/22930580-937e-11e3-827b-88891cf150b8.png)

Note that this commit contains the basic unit testing structure and some basic tests for now. It currently contains test to check whether the plugin menu has been added, and test if the required javascript has been successfully loaded as well. More test cases will be added to the branch feature/unit-testing.

This is a new pull request separated by branch so master pushes not related to unit testing won't get attached to this.