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 <josh.t.richards@gmail.com>
This commit is contained in:
Josh 2025-09-24 20:53:57 -04:00 committed by GitHub
parent 23546013e1
commit 04f30cad62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)