示例#1
0
 public function testPermissionsAreCheckedWhenRemovingFiles()
 {
     $fs = new FileSystem();
     $file = $fs->createFile('/file');
     $file->chmod(00);
     $wr = new Wrapper();
     $this->assertTrue($wr->unlink($fs->path('/file'), 'Allows removals with writable parent'));
     $fs->root()->chmod(0500);
     $this->assertFalse(@$wr->unlink($fs->path('/file'), 'Does not allow removals with non-writable parent'));
     $error = error_get_last();
     $this->assertStringMatchesFormat('rm: %s: Permission denied', $error['message']);
 }