Commits

Ludovic Chabant  committed 288c75c

Fixed a bug in vfsStream where opening a file for read would mark it as modified.

  • Participants
  • Parent commits 5f1e81d

Comments (0)

Files changed (1)

File tests/libs/vfsStream/vfsStreamFile.php

      */
     public function openWithTruncate()
     {
-        $this->open();
+        $this->seek(0, SEEK_SET);
         $this->content = '';
+        $this->updateModifications(true);
     }
 
     /**
      *
      * @since  0.9
      */
-    protected function updateModifications()
+    protected function updateModifications($written = false)
     {
         $time = time();
         $this->lastAccessed = $time;
-        $this->lastModified = $time;
+        if ($written)
+            $this->lastModified = $time;
     }
 
     /**
         return (LOCK_EX === $this->lock);
     }
 }
-?>
+?>