add more FileSystemTest

This commit is contained in:
sunxyw 2022-12-23 22:43:25 +08:00
parent b35d546555
commit 38b70db2dc
No known key found for this signature in database
GPG Key ID: F391C42B19AFFC98

View File

@ -121,4 +121,13 @@ class FileSystemTest extends TestCase
FileSystem::scanDirFiles($this->vfs->url() . '/not_exists');
$this->assertLogged('warning', zm_internal_errcode('E00080') . '扫描目录失败,目录不存在');
}
public function testScanDirFilesWithNoPerm(): void
{
$old_perm = $this->vfs->getPermissions();
$this->vfs->chmod(0000);
FileSystem::scanDirFiles($this->vfs->url());
$this->assertLogged('warning', zm_internal_errcode('E00080') . '扫描目录失败,目录无法读取: ' . $this->vfs->url());
$this->vfs->chmod($old_perm);
}
}