mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-08 12:32:42 +00:00
Renaming tests folders and making tests runnable again
This commit is contained in:
parent
7f31cfb173
commit
0263ffc74e
278 changed files with 21 additions and 24 deletions
|
@ -38,7 +38,7 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader {
|
|||
*/
|
||||
protected function _resolveTestFile($filePath, $params) {
|
||||
$basePath = $this->_basePath($params) . DS . $filePath;
|
||||
$ending = '.test.php';
|
||||
$ending = 'Test.php';
|
||||
return (strpos($basePath, $ending) === (strlen($basePath) - strlen($ending))) ? $basePath : $basePath . $ending;
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader {
|
|||
$result = APP_TEST_CASES;
|
||||
} else if (!empty($params['plugin'])) {
|
||||
$pluginPath = App::pluginPath($params['plugin']);
|
||||
$result = $pluginPath . 'tests' . DS . 'cases';
|
||||
$result = $pluginPath . 'tests' . DS . 'Case';
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
@ -72,7 +72,9 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader {
|
|||
|
||||
$testCases = array();
|
||||
foreach ($fileList as $testCaseFile) {
|
||||
$testCases[$testCaseFile] = str_replace($directory . DS, '', $testCaseFile);
|
||||
$case = str_replace($directory . DS, '', $testCaseFile);
|
||||
$case = str_replace('Test.php', '', $case);
|
||||
$testCases[$testCaseFile] = $case;
|
||||
}
|
||||
return $testCases;
|
||||
}
|
||||
|
@ -92,7 +94,7 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader {
|
|||
|
||||
$files = new RegexIterator(
|
||||
new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)),
|
||||
'/.*\.test.php$/'
|
||||
'/.*Test.php$/'
|
||||
);
|
||||
|
||||
foreach ($files as $file) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue