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 backportbot[bot] committed Sep 19, 2024
1 parent 3b23f89 commit 16910ce
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 @@ -357,6 +357,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 @@ -396,6 +398,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 @@ -448,9 +452,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 @@ -504,6 +512,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 @@ -551,6 +561,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 @@ -594,6 +606,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 @@ -637,6 +651,8 @@ public function testGetByIdMultipleStorages() {

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

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

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

$cache->method('get')
->with(1)
->willReturn($fileInfo);
Expand Down Expand Up @@ -966,9 +979,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 @@ -978,6 +995,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 16910ce

Please sign in to comment.