Permalink
Browse files

Allowing the running of all core test cases via the console

  • Loading branch information...
1 parent 982f161 commit 60154b64be11cdbd149c9222df71109118e9bae4 @AD7six AD7six committed Aug 2, 2009
Showing with 11 additions and 5 deletions.
  1. +11 −5 cake/console/libs/testsuite.php
@@ -235,8 +235,9 @@ function __canRun() {
if ($this->category == 'app' && file_exists($folder.DS.'cases'.DS.$this->file.'.test.php')) {
return true;
}
-
- if ($this->category == 'core' && file_exists($folder.DS.'cases'.DS.'libs'.DS.$this->file.'.test.php')) {
+ $coreCaseExists = file_exists($folder.DS.'cases'.DS.$this->file.'.test.php');
+ $coreLibCaseExists = file_exists($folder.DS.'cases'.DS.'libs'.DS.$this->file.'.test.php');
+ if ($this->category == 'core' && ($coreCaseExists || $coreLibCaseExists)) {
return true;
}
@@ -291,9 +292,14 @@ function __run() {
}
return $result;
}
-
- $case = 'libs'.DS.$this->file.'.test.php';
- if ($this->category == 'app') {
+ if ($this->category === 'core') {
+ $coreCaseExists = file_exists(CORE_TEST_CASES.DS.$this->file.'.test.php');
+ if ($coreCaseExists) {
+ $case = $this->file . '.test.php';
+ } else {
+ $case = 'libs' . DS . $this->file . '.test.php';
+ }
+ } elseif ($this->category === 'app') {
$case = $this->file.'.test.php';
} elseif ($this->isPluginTest) {
$case = $this->file.'.test.php';

0 comments on commit 60154b6

Please sign in to comment.