Skip to content
Permalink
Browse files

Improved error handling for writing the test file to disk

  • Loading branch information...
Jelle Henkens
Jelle Henkens committed Sep 10, 2011
1 parent 38196bd commit 236200ca5692caa2a5ff2eed4c950d364f193c29
Showing with 5 additions and 10 deletions.
  1. +5 −10 lib/Cake/Test/Case/View/Helper/RssHelperTest.php
@@ -682,20 +682,15 @@ public function testElementAttrNotInParent() {
* @param bool $paintSkip
* @return void
*/
function _getWwwTmpFile($paintSkip = true) {
$tmpFile = WWW_ROOT . 'tests' . DS . 'cakephp.file.test.tmp';
function _getWwwTmpFile() {
$path = WWW_ROOT . 'tests' . DS;
$tmpFile = $path. 'cakephp.file.test.tmp';
if (is_writable(dirname($tmpFile)) && (!file_exists($tmpFile) || is_writable($tmpFile))) {
return $tmpFile;
};
if ($paintSkip) {
$trace = debug_backtrace();
$caller = $trace[0]['function'];
$shortPath = dirname($tmpFile);
$message = __d('cake_dev', '[RssHelperTest] Skipping %s because "%s" not writeable!', $caller, $shortPath);
$this->markTestSkipped($message);
}
$message = __d('cake_dev', '%s is not writeable', $path );
$this->markTestSkipped($message);
return false;
}
}

0 comments on commit 236200c

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