Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(tests): Fix Folder tests
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Sep 17, 2024
commit 2bdc97741cd42843f85750421cba032942d860ed
25 changes: 22 additions & 3 deletions tests/lib/Files/Node/FolderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ public function testSearchInRoot(): void {

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

$cache->insert('files', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]);
$cache->insert('files/foo', ['size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']);
Expand Down Expand Up @@ -391,6 +393,8 @@ public function testSearchInStorageRoot(): void {

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

$cache->insert('foo', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]);
$cache->insert('foo/qwerty', ['size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']);
Expand Down Expand Up @@ -442,9 +446,13 @@ public function testSearchSubStorages(): void {

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

$subStorage->method('getCache')
->willReturn($subCache);
$subStorage->method('getOwner')
->willReturn('owner');

$cache->insert('foo', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]);
$cache->insert('foo/qwerty', ['size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']);
Expand Down Expand Up @@ -496,6 +504,8 @@ public function testGetById(): void {

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

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

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

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

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

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

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

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

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

$cache->method('get')
->with(1)
->willReturn($fileInfo);
Expand Down Expand Up @@ -948,9 +961,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 @@ -960,6 +977,8 @@ public function testSearchSubStoragesLimitOffset(int $offset, int $limit, array

$subStorage2->method('getCache')
->willReturn($subCache2);
$subStorage2->method('getOwner')
->willReturn('owner');

$cache->insert('foo/foo1', ['size' => 200, 'mtime' => 10, 'mimetype' => 'text/plain']);
$cache->insert('foo/foo2', ['size' => 200, 'mtime' => 20, 'mimetype' => 'text/plain']);
Expand Down