From 2489608a72b51d4dd95b07bb0a21c92648544bd3 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Tue, 1 Oct 2024 16:14:48 +0200 Subject: [PATCH] refactor(dav): Add Storage parameter strong types Signed-off-by: provokateurin --- apps/dav/lib/Storage/PublicOwnerWrapper.php | 2 +- apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/dav/lib/Storage/PublicOwnerWrapper.php b/apps/dav/lib/Storage/PublicOwnerWrapper.php index 91c1916dc39..635ae04fe64 100644 --- a/apps/dav/lib/Storage/PublicOwnerWrapper.php +++ b/apps/dav/lib/Storage/PublicOwnerWrapper.php @@ -25,7 +25,7 @@ class PublicOwnerWrapper extends Wrapper { $this->owner = $arguments['owner']; } - public function getOwner($path): string|false { + public function getOwner(string $path): string|false { $owner = parent::getOwner($path); if ($owner !== false) { return $owner; diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php index 2e19aec95e8..3490937a543 100644 --- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php @@ -314,6 +314,10 @@ class DirectoryTest extends \Test\TestCase { ->method('getRelativePath') ->willReturn('/foo'); + $this->info->expects($this->once()) + ->method('getInternalPath') + ->willReturn('/foo'); + $mountPoint->method('getMountPoint') ->willReturn('/user/files/mymountpoint'); @@ -358,6 +362,10 @@ class DirectoryTest extends \Test\TestCase { ->method('getMountPoint') ->willReturn($mountPoint); + $this->info->expects($this->once()) + ->method('getInternalPath') + ->willReturn('/foo'); + $mountPoint->method('getMountPoint') ->willReturn('/user/files/mymountpoint'); -- 2.39.5