예제 #1
0
 public function testPermissionsAreCheckedWhenOpeningDirectories()
 {
     $fs = new FileSystem();
     $file = $fs->container()->createDir('/dir');
     $wr = new Wrapper();
     $file->chmod(00);
     $file->chown(0);
     $file->chgrp(0);
     $this->assertFalse(@$wr->dir_opendir($fs->path('/dir'), 0));
     $file->chmod(0200);
     $file->chown($this->uid);
     $file->chgrp(0);
     $this->assertFalse(@$wr->dir_opendir($fs->path('/dir'), 0));
     $file->chmod(0400);
     $file->chown($this->uid);
     $file->chgrp(0);
     $this->assertTrue(@$wr->stream_open($fs->path('/dir'), 'r', 0, $path));
     $file->chmod(040);
     $file->chown(0);
     $file->chgrp($this->gid);
     $this->assertTrue(@$wr->stream_open($fs->path('/dir'), 'r', 0, $path));
 }