Skip to content
Permalink
Browse files

Moved "Test" out of "Cake".

  • Loading branch information...
ADmad committed Jan 6, 2014
1 parent 8fa3606 commit 95539fbff908a6c0dfbaaf38b52852cfa63dc06f
Showing 644 changed files with 97 additions and 91 deletions.
@@ -379,7 +379,7 @@ protected function _mapFileToCase($file, $category, $throwOnMissingFile = true)
$testCase = str_replace(DS, '/', $file);
$testCase = preg_replace('@.*lib/Cake/@', '', $file);
$testCase[0] = strtoupper($testCase[0]);
$testFile = CAKE . 'Test/TestCase/' . $testCase . 'Test.php';
$testFile = ROOT . '/Test/TestCase/' . $testCase . 'Test.php';
if (!file_exists($testFile) && $throwOnMissingFile) {
throw new \Exception(sprintf('Test case %s not found', $testFile));
@@ -428,7 +428,7 @@ protected function _mapFileToCategory($file) {
if (strpos($file, APP) !== false) {
return 'app';
}
if (file_exists(CAKE . $file) || strpos($file, CAKE) !== false) {
if (file_exists(ROOT . DS . $file) || strpos($file, ROOT . DS) !== false) {
return 'core';
}
return 'app';
@@ -104,7 +104,11 @@ public function unregister() {
* @return boolean
*/
public function loadClass($className) {
if (substr($className, 0, $this->_namespaceLength) !== $this->_namespace) {
if (strpos($className, 'Cake\\Test\\') === 0) {
$className = substr($className, 5);
} elseif (strpos($className, 'App\\Test\\') === 0) {
$className = substr($className, 4);
} elseif (substr($className, 0, $this->_namespaceLength) !== $this->_namespace) {
return false;
}
$path = $this->_path . DS . str_replace('\\', DS, $className) . $this->_fileExtension;
File renamed without changes.
File renamed without changes.
Oops, something went wrong.

0 comments on commit 95539fb

Please sign in to comment.
You can’t perform that action at this time.