From 38b70db2dc0ae5360b8365da1dfb19aba4ee8e16 Mon Sep 17 00:00:00 2001 From: sunxyw Date: Fri, 23 Dec 2022 22:43:25 +0800 Subject: [PATCH] add more FileSystemTest --- tests/ZM/Store/FileSystemTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/ZM/Store/FileSystemTest.php b/tests/ZM/Store/FileSystemTest.php index 5f43c09c..fa625ef7 100644 --- a/tests/ZM/Store/FileSystemTest.php +++ b/tests/ZM/Store/FileSystemTest.php @@ -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); + } }