adding test manager test to testsuite test group; small refactorings

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7841 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
DarkAngelBGE 2008-11-07 16:17:18 +00:00
parent be6c24503d
commit 5bd8dbb3ca
4 changed files with 11 additions and 12 deletions

View file

@ -35,8 +35,8 @@ class TestManagerTest extends CakeTestCase {
* @access public
*/
function setUp() {
$this->Sut = new TestManager();
$this->Reporter = new CakeHtmlReporter();
$this->Sut =& new TestManager();
$this->Reporter =& new CakeHtmlReporter();
}
/**
* undocumented function
@ -45,14 +45,14 @@ class TestManagerTest extends CakeTestCase {
* @access public
*/
function testRunAllTests() {
$folder = new Folder($this->Sut->_getTestsPath());
$folder =& new Folder($this->Sut->_getTestsPath());
$extension = str_replace('.', '\.', TestManager::getExtension('test'));
$out = $folder->findRecursive('.*' . $extension);
$reporter = new CakeHtmlReporter();
$reporter =& new CakeHtmlReporter();
$list = TestManager::runAllTests($reporter, true);
$this->assertEqual(count($out), count($list->_test_cases));
$this->assertEqual(count($out), count($list));
}
/**
* undocumented function

View file

@ -52,6 +52,7 @@ class TestSuiteGroupTest extends GroupTest {
* @return void
*/
function TestSuiteGroupTest() {
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'test_manager');
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'code_coverage_manager');
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'cake_test_case');
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'cake_test_fixture');

View file

@ -269,9 +269,7 @@ class CakeTestCase extends UnitTestCase {
? array_intersect_key($_GET, $toSave)
: $this->__savedGetData;
$data = (!empty($params['data']))
? $params['data']
: array();
$data = (!empty($params['data'])) ? $params['data'] : array();
if (strtolower($params['method']) == 'get') {
$_GET = array_merge($this->__savedGetData, $data);

View file

@ -88,12 +88,12 @@ class TestManager {
$test =& new GroupTest('All Core Tests');
}
foreach ($testCases as $testCase) {
$test->addTestFile($testCase);
if ($testing) {
return $testCases;
}
if ($testing) {
return $test;
foreach ($testCases as $testCase) {
$test->addTestFile($testCase);
}
return $test->run($reporter);