From c084456a08249846b049dbe8ae6ea797a4078632 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 25 Jun 2010 23:36:08 -0400 Subject: [PATCH] Moving console and database groups to PHPUnit. Both have some fails caused by the current fixture implementation. Removing groups folder as its no longer used. --- cake/tests/cases/console/all_shells.test.php | 48 +++++++++++++ cake/tests/cases/libs/all_database.test.php | 47 +++++++++++++ cake/tests/groups/console.group.php | 65 ------------------ cake/tests/groups/database.group.php | 52 -------------- .../groups/no_cross_contamination.group.php | 67 ------------------- 5 files changed, 95 insertions(+), 184 deletions(-) create mode 100644 cake/tests/cases/console/all_shells.test.php create mode 100644 cake/tests/cases/libs/all_database.test.php delete mode 100644 cake/tests/groups/console.group.php delete mode 100644 cake/tests/groups/database.group.php delete mode 100644 cake/tests/groups/no_cross_contamination.group.php diff --git a/cake/tests/cases/console/all_shells.test.php b/cake/tests/cases/console/all_shells.test.php new file mode 100644 index 000000000..42807f1d7 --- /dev/null +++ b/cake/tests/cases/console/all_shells.test.php @@ -0,0 +1,48 @@ +addTestFile(CORE_TEST_CASES . DS . 'console' . DS . 'cake.test.php'); + $tasks = array('acl', 'api', 'bake', 'schema', 'shell'); + foreach ($tasks as $task) { + $suite->addTestFile($path . $task . '.test.php'); + } + return $suite; + } +} \ No newline at end of file diff --git a/cake/tests/cases/libs/all_database.test.php b/cake/tests/cases/libs/all_database.test.php new file mode 100644 index 000000000..797541d05 --- /dev/null +++ b/cake/tests/cases/libs/all_database.test.php @@ -0,0 +1,47 @@ +addTestFile($path . $task . '.test.php'); + } + return $suite; + } +} diff --git a/cake/tests/groups/console.group.php b/cake/tests/groups/console.group.php deleted file mode 100644 index 5fdcef1bc..000000000 --- a/cake/tests/groups/console.group.php +++ /dev/null @@ -1,65 +0,0 @@ - - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The Open Group Test Suite License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests - * @package cake - * @subpackage cake.tests.groups - * @since CakePHP(tm) v 1.2.0.4206 - * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License - */ - -/** - * ConsoleGroupTest class - * - * This test group will run all console tests - * - * @package cake - * @subpackage cake.tests.groups - */ -class ConsoleGroupTest extends TestSuite { - -/** - * label property - * - * @var string 'All core cache engines' - * @access public - */ - public $label = 'ShellDispatcher, Shell and all Tasks'; - -/** - * ConsoleGroupTest method - * - * @access public - * @return void - */ - function ConsoleGroupTest() { - TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'console' . DS . 'cake'); - TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'acl'); - TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'api'); - TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'bake'); - TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'schema'); - TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'shell'); - - $path = CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'tasks' . DS; - - TestManager::addTestFile($this, $path . 'controller'); - TestManager::addTestFile($this, $path . 'db_config'); - TestManager::addTestFile($this, $path . 'extract'); - TestManager::addTestFile($this, $path . 'fixture'); - TestManager::addTestFile($this, $path . 'model'); - TestManager::addTestFile($this, $path . 'plugin'); - TestManager::addTestFile($this, $path . 'project'); - TestManager::addTestFile($this, $path . 'test'); - TestManager::addTestFile($this, $path . 'view'); - } -} diff --git a/cake/tests/groups/database.group.php b/cake/tests/groups/database.group.php deleted file mode 100644 index 0a4d70c35..000000000 --- a/cake/tests/groups/database.group.php +++ /dev/null @@ -1,52 +0,0 @@ - - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The Open Group Test Suite License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests - * @package cake - * @subpackage cake.tests.groups - * @since CakePHP(tm) v 1.2.0.5517 - * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License - */ - -/** - * DatabaseGroupTest class - * - * This test group will run all behavior, schema and datasource tests excluding database - * driver-specific tests - * - * @package cake - * @subpackage cake.tests.groups - */ -class DatabaseGroupTest extends TestSuite { - -/** - * label property - * - * @var string 'All model tests' - * @access public - */ - public $label = 'Datasources, Schema and DbAcl tests'; - -/** - * ModelGroupTest method - * - * @access public - * @return void - */ - function DatabaseGroupTest() { - TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'db_acl'); - TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'cake_schema'); - TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'connection_manager'); - TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'datasources' . DS . 'dbo_source'); - } -} diff --git a/cake/tests/groups/no_cross_contamination.group.php b/cake/tests/groups/no_cross_contamination.group.php deleted file mode 100644 index 5a3bce77c..000000000 --- a/cake/tests/groups/no_cross_contamination.group.php +++ /dev/null @@ -1,67 +0,0 @@ - - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The Open Group Test Suite License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests - * @package cake - * @subpackage cake.tests.groups - * @since CakePHP(tm) v 1.2.0.4206 - * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License - */ - -/** - * NoCrossContaminationGroupTest class - * - * This test group will run all tests - * that are proper isolated to be run in sequence - * without affected each other - * - * @package cake - * @subpackage cake.tests.groups - */ -class NoCrossContaminationGroupTest extends TestSuite { - -/** - * label property - * - * @var string - * @access public - */ - public $label = 'No Cross Contamination'; - -/** - * blacklist property - * - * @var string - * @access public - */ - public $blacklist = array('cake_test_case.test.php', 'object.test.php'); - -/** - * NoCrossContaminationGroupTest method - * - * @access public - * @return void - */ - function NoCrossContaminationGroupTest() { - App::import('Core', 'Folder'); - - $Folder = new Folder(CORE_TEST_CASES); - - foreach ($Folder->findRecursive('.*\.test\.php', true) as $file) { - if (in_array(basename($file), $this->blacklist)) { - continue; - } - TestManager::addTestFile($this, $file); - } - } -}