Permalink
Browse files

Improving console group test suite.

Still getting intermittant fails from controller task.
  • Loading branch information...
1 parent ac97dfd commit d956378d48fe599ea9560917bc15623e9239fe22 @markstory markstory committed Nov 1, 2009
Showing with 24 additions and 7 deletions.
  1. +6 −6 cake/tests/cases/console/libs/tasks/model.test.php
  2. +18 −1 cake/tests/groups/console.group.php
@@ -21,7 +21,7 @@
* @since CakePHP v 1.2.6
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-App::import('Core', 'Shell');
+App::import('Shell', 'Shell', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
@@ -34,9 +34,9 @@
ob_end_clean();
}
-if (!class_exists('TestTask')) {
- require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php';
-}
+require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php';
+require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'fixture.php';
+require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php';
Mock::generatePartial(
'ShellDispatcher', 'TestModelTaskMockShellDispatcher',
@@ -216,9 +216,9 @@ function testFieldValidationGuessing() {
function testInteractiveFieldValidation() {
$this->Task->initValidations();
$this->Task->interactive = true;
- $this->Task->setReturnValueAt(0, 'in', '20');
+ $this->Task->setReturnValueAt(0, 'in', '19');
$this->Task->setReturnValueAt(1, 'in', 'y');
- $this->Task->setReturnValueAt(2, 'in', '16');
+ $this->Task->setReturnValueAt(2, 'in', '15');
$this->Task->setReturnValueAt(3, 'in', 'n');
$result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false));
@@ -46,7 +46,24 @@ class ConsoleGroupTest extends TestSuite {
* @return void
*/
function ConsoleGroupTest() {
- TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'console');
+ 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 . 'model');
+ TestManager::addTestFile($this, $path . 'view');
+ TestManager::addTestFile($this, $path . 'fixture');
+ TestManager::addTestFile($this, $path . 'test');
+ TestManager::addTestFile($this, $path . 'db_config');
+ TestManager::addTestFile($this, $path . 'plugin');
+ TestManager::addTestFile($this, $path . 'project');
+
}
}
?>

0 comments on commit d956378

Please sign in to comment.