From 840cd1a3ecdd9cdabec2d9fb381329d42713825f Mon Sep 17 00:00:00 2001 From: Matthew Hilton Date: Thu, 10 Oct 2024 09:55:43 +1000 Subject: [PATCH] tests: reset static file storage before tests --- tests/tool_objectfs_testcase.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/tool_objectfs_testcase.php b/tests/tool_objectfs_testcase.php index afc859ee..c7a477e5 100644 --- a/tests/tool_objectfs_testcase.php +++ b/tests/tool_objectfs_testcase.php @@ -42,6 +42,11 @@ protected function setUp(): void { $this->filesystem = new test_file_system(); $this->logger = new \tool_objectfs\log\null_logger(); + // Get the file system with reset flag enabled to reset it, + // since it is static and may have been initialised as a filedir system in another test + // instead of the desired objectfs test file system. + get_file_storage(true); + $this->resetAfterTest(true); }