Add instructions for running phpunit

This commit is contained in:
Samuel Georges 2015-08-08 15:45:32 +10:00
parent e97e6804f2
commit 364809a38e
1 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# Plugin testing
Plugin unit tests can be performed by running `phpunit` in the base plugin directory.
### Creating plugin tests
Plugins can be tested by creating a creating a file called `phpunit.xml` in the base directory with the following content, for example, in a file **/plugins/acme/blog/phpunit.xml**:
<?xml version="1.0" encoding="UTF-8"?>
@ -42,10 +46,11 @@ Then a **tests/** directory can be created to contain the test classes. The file
}
}
The test class should extend the base class `PluginTestCase` and this is a special class that will set up the October database stored in memory, as part of the `setup()` method. It will also refresh the plugin being testing, along with any of the defined dependencies in the plugin registration file. This is the equivalent of running the following before each test:
The test class should extend the base class `PluginTestCase` and this is a special class that will set up the October database stored in memory, as part of the `setUp()` method. It will also refresh the plugin being testing, along with any of the defined dependencies in the plugin registration file. This is the equivalent of running the following before each test:
php artisan october:up
php artisan plugin:refresh Acme.Blog
[php artisan plugin:refresh <dependency>, ...]
# System testing