Пример #1
0
 public function testGetAbsolutePath()
 {
     $this->assertContains("/", (string) $this->file->getAbsolutePath());
     $this->assertContains("/", (string) $this->file->getCanonicalPath());
     $this->assertContains("/", (string) $this->fileAbs->getAbsolutePath());
     $this->assertContains("/", (string) $this->dir->getAbsolutePath());
     $this->assertContains("/", (string) $this->dirAbs->getAbsolutePath());
     $this->assertContains("/", (string) $this->fileRoot->getAbsolutePath());
     $this->assertContains((string) System::getProperty('user.home'), (string) $this->file->getAbsolutePath());
     $this->assertContains((string) System::getProperty('user.home'), (string) $this->fileAbs->getAbsolutePath());
     $this->assertContains((string) System::getProperty('user.home'), (string) $this->dir->getAbsolutePath());
     $this->assertContains((string) System::getProperty('user.home'), (string) $this->dirAbs->getAbsolutePath());
     $this->assertContains((string) System::getProperty('user.home'), (string) $this->fileRoot->getAbsolutePath());
     $this->assertContains((string) $this->file->getPath(), (string) $this->file->getAbsolutePath());
     $this->assertContains((string) $this->fileAbs->getPath(), (string) $this->fileAbs->getAbsolutePath());
     $this->assertContains((string) $this->dir->getPath(), (string) $this->dir->getAbsolutePath());
     $this->assertContains((string) $this->dirAbs->getPath(), (string) $this->dirAbs->getAbsolutePath());
     $this->assertContains((string) $this->fileRoot->getPath(), (string) $this->fileRoot->getAbsolutePath());
 }
Пример #2
0
 /**
  * Compute the hash code of an abstract pathname.
  * @param File $f
  * @return int
  */
 public function hashCodeFile(File $f)
 {
     return (new String($f->getPath()))->hashCode() ^ 1234321;
 }
Пример #3
0
 /**
  * Set the last-modified time of the file or directory denoted by the
  * given pathname, returning <code>true</code> if and only if the
  * operation succeeds.
  * @param File $f
  * @param int $time
  * @return bool
  */
 public function setLastModifiedTime(File $f, $time = null)
 {
     return $this->fs->touch($f->getPath(), $time);
 }