|
|
@@ -399,7 +399,7 @@ class FileTest extends CakeTestCase {
|
|
|
public function testDelete() {
|
|
|
if (!$tmpFile = $this->_getTmpFile()) {
|
|
|
return false;
|
|
|
- };
|
|
|
+ }
|
|
|
|
|
|
if (!file_exists($tmpFile)) {
|
|
|
touch($tmpFile);
|
|
|
@@ -416,6 +416,24 @@ class FileTest extends CakeTestCase {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Windows has issues unlinking files if there are
|
|
|
+ * active filehandles open.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ function testDeleteAfterRead() {
|
|
|
+ if (!$tmpFile = $this->_getTmpFile()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!file_exists($tmpFile)) {
|
|
|
+ touch($tmpFile);
|
|
|
+ }
|
|
|
+ $file =& new File($tmpFile);
|
|
|
+ $file->read();
|
|
|
+ $this->assertTrue($file->delete());
|
|
|
+ }
|
|
|
+
|
|
|
+/**
|
|
|
* testCopy method
|
|
|
*
|
|
|
* @return void
|