From 522f1540049b1470b380a120166e74cdee8f8676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 17 Sep 2024 19:19:08 +0200 Subject: [PATCH] fix(tests): Fix Folder tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- tests/lib/Files/Node/FolderTest.php | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tests/lib/Files/Node/FolderTest.php b/tests/lib/Files/Node/FolderTest.php index c0c14128d6f50..9a3433c020e5e 100644 --- a/tests/lib/Files/Node/FolderTest.php +++ b/tests/lib/Files/Node/FolderTest.php @@ -356,6 +356,8 @@ public function testSearchInRoot() { $storage->method('getCache') ->willReturn($cache); + $storage->method('getOwner') + ->willReturn('owner'); $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); $cache->insert('files', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); @@ -395,6 +397,8 @@ public function testSearchInStorageRoot() { $storage->method('getCache') ->willReturn($cache); + $storage->method('getOwner') + ->willReturn('owner'); $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); $cache->insert('foo', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); @@ -447,9 +451,13 @@ public function testSearchSubStorages() { $storage->method('getCache') ->willReturn($cache); + $storage->method('getOwner') + ->willReturn('owner'); $subStorage->method('getCache') ->willReturn($subCache); + $subStorage->method('getOwner') + ->willReturn('owner'); $cache->insert('', ['size' => 0, 'mtime' => 0, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); $cache->insert('foo', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); @@ -503,6 +511,8 @@ public function testGetById() { $storage->method('getCache') ->willReturn($cache); + $storage->method('getOwner') + ->willReturn('owner'); $this->userMountCache->expects($this->any()) ->method('getMountsForFileId') @@ -550,6 +560,8 @@ public function testGetByIdMountRoot() { $storage->method('getCache') ->willReturn($cache); + $storage->method('getOwner') + ->willReturn('owner'); $this->userMountCache->expects($this->any()) ->method('getMountsForFileId') @@ -593,6 +605,8 @@ public function testGetByIdOutsideFolder() { $storage->method('getCache') ->willReturn($cache); + $storage->method('getOwner') + ->willReturn('owner'); $this->userMountCache->expects($this->any()) ->method('getMountsForFileId') @@ -636,6 +650,8 @@ public function testGetByIdMultipleStorages() { $storage->method('getCache') ->willReturn($cache); + $storage->method('getOwner') + ->willReturn('owner'); $this->userMountCache->method('getMountsForFileId') ->with(1) @@ -651,9 +667,6 @@ public function testGetByIdMultipleStorages() { ), ]); - $storage->method('getCache') - ->willReturn($cache); - $cache->method('get') ->with(1) ->willReturn($fileInfo); @@ -965,9 +978,13 @@ public function testSearchSubStoragesLimitOffset(int $offset, int $limit, array $storage->method('getCache') ->willReturn($cache); + $storage->method('getOwner') + ->willReturn('owner'); $subStorage1->method('getCache') ->willReturn($subCache1); + $subStorage1->method('getOwner') + ->willReturn('owner'); $subMount2->method('getStorage') ->willReturn($subStorage2); @@ -977,6 +994,8 @@ public function testSearchSubStoragesLimitOffset(int $offset, int $limit, array $subStorage2->method('getCache') ->willReturn($subCache2); + $subStorage2->method('getOwner') + ->willReturn('owner'); $cache->insert('', ['size' => 0, 'mtime' => 10, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]);