Skip to content

Commit

Permalink
fix(tests): Fix Folder tests
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc authored and icewind1991 committed Sep 19, 2024
1 parent 6b7d252 commit 522f154
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions tests/lib/Files/Node/FolderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -503,6 +511,8 @@ public function testGetById() {

$storage->method('getCache')
->willReturn($cache);
$storage->method('getOwner')
->willReturn('owner');

$this->userMountCache->expects($this->any())
->method('getMountsForFileId')
Expand Down Expand Up @@ -550,6 +560,8 @@ public function testGetByIdMountRoot() {

$storage->method('getCache')
->willReturn($cache);
$storage->method('getOwner')
->willReturn('owner');

$this->userMountCache->expects($this->any())
->method('getMountsForFileId')
Expand Down Expand Up @@ -593,6 +605,8 @@ public function testGetByIdOutsideFolder() {

$storage->method('getCache')
->willReturn($cache);
$storage->method('getOwner')
->willReturn('owner');

$this->userMountCache->expects($this->any())
->method('getMountsForFileId')
Expand Down Expand Up @@ -636,6 +650,8 @@ public function testGetByIdMultipleStorages() {

$storage->method('getCache')
->willReturn($cache);
$storage->method('getOwner')
->willReturn('owner');

$this->userMountCache->method('getMountsForFileId')
->with(1)
Expand All @@ -651,9 +667,6 @@ public function testGetByIdMultipleStorages() {
),
]);

$storage->method('getCache')
->willReturn($cache);

$cache->method('get')
->with(1)
->willReturn($fileInfo);
Expand Down Expand Up @@ -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);
Expand All @@ -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]);
Expand Down

0 comments on commit 522f154

Please sign in to comment.