Skip to content
Permalink
Browse files

Adding a params var to the TestManager to hold through the lifecicle …

…of the object
  • Loading branch information...
lorenzo committed Jul 7, 2010
1 parent 5d8e27d commit cdf52a890fb1972b73db178abf325e4a7cef3079
Showing with 10 additions and 8 deletions.
  1. +10 −8 cake/tests/lib/test_manager.php
@@ -75,13 +75,22 @@ class TestManager {
*/
protected $_fixtureManager = null;
/**
* Params to configure test runner
*
* @var CakeFixtureManager
*/
public $params = array();
/**
* Constructor for the TestManager class
*
* @return void
*/
public function __construct($params = array()) {
require_once(CAKE_TESTS_LIB . 'cake_test_case.php');
$this->params = $params;
if (isset($params['app'])) {
$this->appTest = true;
}
@@ -130,14 +139,7 @@ public function runAllTests(&$reporter) {
* @return mixed Result of test case being run.
*/
public function runTestCase($testCaseFile, PHPUnit_Framework_TestListener $reporter, $codeCoverage = false) {
$testCaseFileWithPath = $this->_getTestsPath($reporter->params) . DS . $testCaseFile;
if (!file_exists($testCaseFileWithPath) || strpos($testCaseFileWithPath, '..')) {
throw new InvalidArgumentException(sprintf(__('Unable to load test file %s'), htmlentities($testCaseFile)));
}
$testSuite = $this->getTestSuite(sprintf(__('Individual test case: %s', true), $testCaseFile));
$testSuite->addTestFile($testCaseFileWithPath);
$this->loadCase($testCaseFile);
return $this->run($reporter, $codeCoverage);
}

0 comments on commit cdf52a8

Please sign in to comment.
You can’t perform that action at this time.