/**
  * setting and retrieving owner group of a file
  *
  * @test
  * @group  permissions
  */
 public function group()
 {
     $this->assertEquals(vfsStream::getCurrentGroup(), $this->file->getGroup());
     $this->assertTrue($this->file->isOwnedByGroup(vfsStream::getCurrentGroup()));
     $this->assertSame($this->file, $this->file->chgrp(vfsStream::GROUP_USER_1));
     $this->assertEquals(vfsStream::GROUP_USER_1, $this->file->getGroup());
     $this->assertTrue($this->file->isOwnedByGroup(vfsStream::GROUP_USER_1));
 }
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);
 }