Permalink
Browse files

Correcting spacing in file test.

Correctly constructing a File object, so testRead does not rely on the previous test to leave the object in the correct state.
  • Loading branch information...
1 parent c96d074 commit 25a6a3cac84b34a3d5a93cbca0ec4e1910dc4901 @markstory markstory committed May 29, 2010
Showing with 6 additions and 3 deletions.
  1. +6 −3 cake/tests/cases/libs/file.test.php
@@ -104,6 +104,9 @@ function testBasic() {
* @return void
*/
function testRead() {
+ $file = __FILE__;
+ $this->File =& new File($file);
+
$result = $this->File->read();
$expecting = file_get_contents(__FILE__);
$this->assertEqual($result, $expecting);
@@ -445,7 +448,7 @@ function testCopy() {
* @return void
*/
function _getTmpFile($paintSkip = true) {
- $tmpFile = TMP.'tests'.DS.'cakephp.file.test.tmp';
+ $tmpFile = TMP . 'tests' . DS . 'cakephp.file.test.tmp';
if (is_writable(dirname($tmpFile)) && (!file_exists($tmpFile) || is_writable($tmpFile))) {
return $tmpFile;
};
@@ -454,14 +457,14 @@ function _getTmpFile($paintSkip = true) {
$caller = 'test';
if (function_exists('debug_backtrace')) {
$trace = debug_backtrace();
- $caller = $trace[1]['function'].'()';
+ $caller = $trace[1]['function'] . '()';
}
$assertLine = new SimpleStackTrace(array(__FUNCTION__));
$assertLine = $assertLine->traceMethod();
$shortPath = substr($tmpFile, strlen(ROOT));
$message = '[FileTest] Skipping %s because "%s" not writeable!';
- $message = sprintf(__($message, true), $caller, $shortPath).$assertLine;
+ $message = sprintf(__($message, true), $caller, $shortPath) . $assertLine;
$this->_reporter->paintSkip($message);
}
return false;

0 comments on commit 25a6a3c

Please sign in to comment.