mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
be6c24503d
commit
5bd8dbb3ca
4 changed files with 11 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue