Skip to content

Commit

Permalink
Synchronizing defaults in test Report and Dispatcher.
Browse files Browse the repository at this point in the history
Changing default for `'reporter'` in `Dispatcher`.
Adding missing options documentation.
  • Loading branch information
mariuswilms committed May 23, 2012
1 parent 5a92d99 commit dc68018
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
11 changes: 7 additions & 4 deletions test/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ class Dispatcher extends \lithium\core\StaticObject {
* @param string $group If set, this test group is run. If not set, a group test may
* also be run by passing the 'group' option to the $options parameter.
* @param array $options Options array for the test run. Valid options are:
* - 'case': The fully namespaced test case to be run.
* - 'group': The fully namespaced test group to be run.
* - 'filters': An array of filters that the test output should be run through.
* - `'case'`: The fully namespaced test case to be run.
* - `'group'`: The fully namespaced test group to be run.
* - `'filters'`: An array of filters that the test output should be run through.
* - `'reporter'`: The reporter to use, defaults to `'console'`.
* - `'format'`: The format of the reporter template to use, defaults to `'txt'`.
* @return array A compact array of the title, an array of the results, as well
* as an additional array of the results after the $options['filters']
* have been applied.
Expand All @@ -49,7 +51,8 @@ public static function run($group = null, array $options = array()) {
$defaults = array(
'title' => $group,
'filters' => array(),
'reporter' => 'text'
'reporter' => 'console',
'format' => 'txt'
);
$options += $defaults;
$isCase = is_string($group) && preg_match('/Test$/', $group);
Expand Down
10 changes: 6 additions & 4 deletions test/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,18 @@ class Report extends \lithium\core\Object {
* Construct Report Object
*
* @param array $config Options array for the test run. Valid options are:
* - 'group': The test group with items to be run.
* - 'filters': An array of filters that the test output should be run through.
* - `'group'`: The test group with items to be run.
* - `'filters'`: An array of filters that the test output should be run through.
* - `'reporter'`: The reporter to use, defaults to `'console'`.
* - `'format'`: The format of the reporter template to use, defaults to `'txt'`.
*/
public function __construct(array $config = array()) {
$defaults = array(
'title' => null,
'group' => null,
'filters' => array(),
'format' => 'txt',
'reporter' => 'console'
'reporter' => 'console',
'format' => 'txt'
);
parent::__construct($config + $defaults);
}
Expand Down

0 comments on commit dc68018

Please sign in to comment.