mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Creating a factory method for the runner creation.
This commit is contained in:
parent
78dd89027d
commit
1c9808fdca
1 changed files with 12 additions and 2 deletions
|
@ -61,7 +61,7 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
|
||||||
public function run(array $argv, $exit = true) {
|
public function run(array $argv, $exit = true) {
|
||||||
$this->handleArguments($argv);
|
$this->handleArguments($argv);
|
||||||
|
|
||||||
$runner = new CakeTestRunner($this->arguments['loader'], $this->_params);
|
$runner = $this->getRunner($this->arguments['loader']);
|
||||||
|
|
||||||
if (is_object($this->arguments['test']) &&
|
if (is_object($this->arguments['test']) &&
|
||||||
$this->arguments['test'] instanceof PHPUnit_Framework_Test) {
|
$this->arguments['test'] instanceof PHPUnit_Framework_Test) {
|
||||||
|
@ -131,13 +131,23 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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/
|
* Handler for customizing the FixtureManager class/
|
||||||
*
|
*
|
||||||
* @param string $class Name of the class that will be the fixture manager
|
* @param string $class Name of the class that will be the fixture manager
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function handleFixture($class) {
|
public function handleFixture($class) {
|
||||||
$this->arguments['fixtureManager'] = $class;
|
$this->arguments['fixtureManager'] = $class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue