/**
  * setting and retrieving permissions for a file
  *
  * @test
  * @group  permissions
  */
 public function permissionsSet()
 {
     $this->file = new vfsStreamFile('foo', 0644);
     $this->assertEquals(0644, $this->file->getPermissions());
     $this->assertSame($this->file, $this->file->chmod(0600));
     $this->assertEquals(0600, $this->file->getPermissions());
 }
Exemple #2
0
 /**
  * returns status of stream
  *
  * @return  array
  */
 public function stream_stat()
 {
     $fileStat = array('dev' => 0, 'ino' => 0, 'mode' => $this->content->getType() | $this->content->getPermissions(), 'nlink' => 0, 'uid' => $this->content->getUser(), 'gid' => $this->content->getGroup(), 'rdev' => 0, 'size' => $this->content->size(), 'atime' => $this->content->filemtime(), 'mtime' => $this->content->filemtime(), 'ctime' => $this->content->filemtime(), 'blksize' => -1, 'blocks' => -1);
     return array_merge(array_values($fileStat), $fileStat);
 }
 /**
  * @test
  */
 public function createFileWithDifferentUmaskSetting()
 {
     vfsStream::umask(022);
     $file = new vfsStreamFile('foo');
     $this->assertEquals(0644, $file->getPermissions());
 }