]> source.dussan.org Git - nextcloud-server.git/commitdiff
refactor(dav): Add Storage parameter strong types
authorprovokateurin <kate@provokateurin.de>
Tue, 1 Oct 2024 14:14:48 +0000 (16:14 +0200)
committerprovokateurin <kate@provokateurin.de>
Mon, 7 Oct 2024 13:00:07 +0000 (15:00 +0200)
Signed-off-by: provokateurin <kate@provokateurin.de>
apps/dav/lib/Storage/PublicOwnerWrapper.php
apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php

index 91c1916dc39b4d81f05bc47da4218d41bccb4789..635ae04fe647a51449557ef4214130f604ef3527 100644 (file)
@@ -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;
index 2e19aec95e86f12414c3d62dd9dbebf6c078076a..3490937a543e9f82573a2da2997568fe3f2dbd8d 100644 (file)
@@ -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');