mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 18:50:47 -04:00
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:
parent
23546013e1
commit
04f30cad62
1 changed files with 8 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue