Skip to content

Commit

Permalink
Add instructions for running phpunit
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Aug 8, 2015
1 parent e97e680 commit 364809a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
@@ -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"?>
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 364809a

Please sign in to comment.