Skip to content

Commit cdf52a8

Browse files
committed
Adding a params var to the TestManager to hold through the lifecicle of the object
1 parent 5d8e27d commit cdf52a8

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

cake/tests/lib/test_manager.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,22 @@ class TestManager {
7575
*/
7676
protected $_fixtureManager = null;
7777

78+
/**
79+
* Params to configure test runner
80+
*
81+
* @var CakeFixtureManager
82+
*/
83+
public $params = array();
84+
7885
/**
7986
* Constructor for the TestManager class
8087
*
8188
* @return void
8289
*/
8390
public function __construct($params = array()) {
8491
require_once(CAKE_TESTS_LIB . 'cake_test_case.php');
92+
93+
$this->params = $params;
8594
if (isset($params['app'])) {
8695
$this->appTest = true;
8796
}
@@ -130,14 +139,7 @@ public function runAllTests(&$reporter) {
130139
* @return mixed Result of test case being run.
131140
*/
132141
public function runTestCase($testCaseFile, PHPUnit_Framework_TestListener $reporter, $codeCoverage = false) {
133-
$testCaseFileWithPath = $this->_getTestsPath($reporter->params) . DS . $testCaseFile;
134-
135-
if (!file_exists($testCaseFileWithPath) || strpos($testCaseFileWithPath, '..')) {
136-
throw new InvalidArgumentException(sprintf(__('Unable to load test file %s'), htmlentities($testCaseFile)));
137-
}
138-
139-
$testSuite = $this->getTestSuite(sprintf(__('Individual test case: %s', true), $testCaseFile));
140-
$testSuite->addTestFile($testCaseFileWithPath);
142+
$this->loadCase($testCaseFile);
141143
return $this->run($reporter, $codeCoverage);
142144
}
143145

0 commit comments

Comments
 (0)