mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Improved error handling for writing the test file to disk
This commit is contained in:
parent
38196bda3f
commit
236200ca56
1 changed files with 5 additions and 10 deletions
|
@ -682,20 +682,15 @@ class RssHelperTest extends CakeTestCase {
|
||||||
* @param bool $paintSkip
|
* @param bool $paintSkip
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _getWwwTmpFile($paintSkip = true) {
|
function _getWwwTmpFile() {
|
||||||
$tmpFile = WWW_ROOT . 'tests' . DS . 'cakephp.file.test.tmp';
|
$path = WWW_ROOT . 'tests' . DS;
|
||||||
|
$tmpFile = $path. 'cakephp.file.test.tmp';
|
||||||
if (is_writable(dirname($tmpFile)) && (!file_exists($tmpFile) || is_writable($tmpFile))) {
|
if (is_writable(dirname($tmpFile)) && (!file_exists($tmpFile) || is_writable($tmpFile))) {
|
||||||
return $tmpFile;
|
return $tmpFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($paintSkip) {
|
$message = __d('cake_dev', '%s is not writeable', $path );
|
||||||
$trace = debug_backtrace();
|
$this->markTestSkipped($message);
|
||||||
$caller = $trace[0]['function'];
|
|
||||||
$shortPath = dirname($tmpFile);
|
|
||||||
|
|
||||||
$message = __d('cake_dev', '[RssHelperTest] Skipping %s because "%s" not writeable!', $caller, $shortPath);
|
|
||||||
$this->markTestSkipped($message);
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue