Test Runner - Runners
Runners are the cornerstone of the test runner. They actually run the tests that the scanners locate.
Configuration Structure
The following is the basic structure for configuring a test runner.
<config>
<dependencycache>
<file>/path/to/cache/resolvedDependency.cache</file>
</dependencycache>
...
<runner>
<type>PHPUnit</type>
<options>
<suite>
<path>/path/to/PHPUnit/</path>
</suite>
</options>
</runner>
</config>
In the above snippit, most of the items should be self explanitory except for the dependency cache. This optional configuration section enables the test runner to take is a snapshot of every file that the current test included. This is stored after getting rid of the test suite's files, and at this point if you were using a dependency connector in the connectors section of the configuration, you could leverage this caching behavior to your advantage.
Note: You may have noticed the use of runner with no reference to runners. This is not a mistake, there can currently only be one runner.
Available Runners
Currently there are two types of runners which basically wrap the two best php unit test suites. The runners and their means of configuration are described in the tabs below.
PHPUnit
"an open source framework for test-driven development with the PHP programming language" -- PHPUnit Pocket Guide
PHPUnit is by far the best unit testing suite for php. The Blerby Test Runner was written to around some of the elements present in PHPUnit.
Unfortunately there is no code coverage support at this time.
Requirements
1. You must download PHPUnit from http://www.phpunit.de/.
2. You must put PHPUnit your php include_path or add an include paths directive like so
Configuration
<config>
...
<runner>
<type>PHPUnit</type>
<options>
<suite>
<path>/path/to/PHPUnit/</path>
</suite>
</options>
</runner>
</config>
Source
Source for the PHPUnit Runner: TestRunner/library/Blerby/TestRunner/Runner/PHPUnit.php
SimpleTest
"What is it? It's a framework for unit testing, web site testing and mock objects for PHP 4.2.0+
(and PHP 5.0 to 5.3 without E_STRICT)." - SimpleTest README
Please be warned! SimpleTest support may conflict with our licensing scheme! The Simpletest runner and friends may be moved into a seperate directory for manual downloading.
Requirements
1. Get SimpleTest: http://simpletest.sourceforge.net/projects/simpletest/
2. You must put SimpleTest your php include_path or add an include paths directive like so
Configuration
<config>
...
<runner>
<type>SimpleTest</type>
<options>
<suite>
<path>/path/to/SimpleTest/</path>
</suite>
</options>
</runner>
</config>
Source
Source for the SimpleTest Runner: TestRunner/library/Blerby/TestRunner/Runner/SimpleTest.php
Javascript
Using John Resig's env.js, a slightly modified version of Rhino, and YUI Test a new Javascript testing utility has been born.
Requirements
1. You will need to add java(.exe) to your PATH environment variable
Configuration
<config>
...
<runner>
<type>Javascript</type>
<options>
<pathToCode> ... </pathToCode>
</options>
</runner>
</config>
Source
Source for the Javascript Test Runner: TestRunner/library/Blerby/TestRunner/Runner/Javascript.php
Source
Source to the base runner implementation: TestRunner/library/Blerby/TestRunner/Runner.php