From 364809a38ee7c8358172692726bc2e09f3779f2e Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 8 Aug 2015 15:45:32 +1000 Subject: [PATCH] Add instructions for running phpunit --- tests/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/README.md b/tests/README.md index d5e24ef1e..f04d5fb2b 100644 --- a/tests/README.md +++ b/tests/README.md @@ -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**: @@ -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 , ...] # System testing