Skip to content

Commit

Permalink
Creating a factory method for the runner creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Feb 13, 2011
1 parent 78dd890 commit 1c9808f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions cake/tests/lib/cake_test_suite_command.php
Expand Up @@ -61,7 +61,7 @@ public function __construct($loader, $params = array()) {
public function run(array $argv, $exit = true) {
$this->handleArguments($argv);

$runner = new CakeTestRunner($this->arguments['loader'], $this->_params);
$runner = $this->getRunner($this->arguments['loader']);

if (is_object($this->arguments['test']) &&
$this->arguments['test'] instanceof PHPUnit_Framework_Test) {
Expand Down Expand Up @@ -131,13 +131,23 @@ public function run(array $argv, $exit = true) {
}
}

/**
* Create a runner for the command.
*
* @param $loader The loader to be used for the test run.
* @return CakeTestRunner
*/
public function getRunner($loader) {
return new CakeTestRunner($loader, $this->_params);
}

/**
* Handler for customizing the FixtureManager class/
*
* @param string $class Name of the class that will be the fixture manager
* @return void
*/
function handleFixture($class) {
public function handleFixture($class) {
$this->arguments['fixtureManager'] = $class;
}

Expand Down

0 comments on commit 1c9808f

Please sign in to comment.