Skip to content

Commit

Permalink
allowing \test\Controller timeout to be set via params.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwoo authored and nateabele committed Feb 10, 2011
1 parent fd09a84 commit 0a74653
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/lithium/test/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ class Controller extends \lithium\core\Object {
public function __invoke($request, $dispatchParams, array $options = array()) {
$dispatchParamsDefaults = array('args' => array());
$dispatchParams += $dispatchParamsDefaults;
$defaults = array('reporter' => 'html', 'format' => 'html');
$defaults = array('reporter' => 'html', 'format' => 'html', 'timeout' => 0);
$options += (array) $request->query + $defaults;
$params = compact('request', 'dispatchParams', 'options');
set_time_limit(0);

return $this->_filter(__METHOD__, $params, function($self, $params) {
$request = $params['request'];
$options = $params['options'];
$params = $params['dispatchParams'];
set_time_limit((integer) $options['timeout']);
$group = join('\\', (array) $params['args']);

if ($group === "all") {
$group = Group::all();
$options['title'] = 'All Tests';
}
$report = Dispatcher::run($group , $options);
$report = Dispatcher::run($group, $options);
$filters = Libraries::locate('test.filter');
$menu = Libraries::locate('tests', null, array(
'filter' => '/cases|integration|functional/',
Expand Down

0 comments on commit 0a74653

Please sign in to comment.