From 04f30cad6261f5be1e69282dea25adfc623bfa01 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 24 Sep 2025 20:53:57 -0400 Subject: [PATCH] chore: drop buildFileViewMock cast and give it a docblock Updated the buildFileViewMock method to accept int, float, or false as quota type. Signed-off-by: Josh --- apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php index 9df9d636184..e76817a8987 100644 --- a/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php @@ -19,7 +19,7 @@ class QuotaPluginTest extends TestCase { private QuotaPlugin $plugin; private function init(int $quota, string $checkedPath = ''): void { - $view = $this->buildFileViewMock((string)$quota, $checkedPath); + $view = $this->buildFileViewMock($quota, $checkedPath); $this->server = new \Sabre\DAV\Server(); $this->plugin = new QuotaPlugin($view); $this->plugin->initialize($this->server); @@ -136,6 +136,13 @@ class QuotaPluginTest extends TestCase { ]; } + /** + * Build a mock for the View class with a controlled free_space() response. + * + * @param int|float|false $quota The quota value to return from free_space(). + * @param string $checkedPath The path expected as a parameter to free_space(). + * @return View&\PHPUnit\Framework\MockObject\MockObject + */ private function buildFileViewMock(int|float|false $quota, string $checkedPath): View { // mock filesystem $view = $this->getMockBuilder(View::class)