aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-02-09 09:54:52 +0100
committerRobin Appelman <robin@icewind.nl>2024-03-04 13:57:31 +0100
commite7a7b4a40184dc3da2c83e858c820625f660e48e (patch)
tree367bda0ac814376e7c771fbe4b1c40cf7f33df53 /apps/files/tests
parent4d110c1dd6ae384c00c93b4e266118004b71e498 (diff)
downloadnextcloud-server-e7a7b4a40184dc3da2c83e858c820625f660e48e.tar.gz
nextcloud-server-e7a7b4a40184dc3da2c83e858c820625f660e48e.zip
perf: switch places that always use the first getById result to getFirstNodeById
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/Controller/ViewControllerTest.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php
index 0b71011f60c..2714a6b25c0 100644
--- a/apps/files/tests/Controller/ViewControllerTest.php
+++ b/apps/files/tests/Controller/ViewControllerTest.php
@@ -167,7 +167,7 @@ class ViewControllerTest extends TestCase {
[$this->user->getUID(), 'files', 'crop_image_previews', true, true],
[$this->user->getUID(), 'files', 'show_grid', true],
]);
-
+
$baseFolderFiles = $this->getMockBuilder(Folder::class)->getMock();
$this->rootFolder->expects($this->any())
@@ -228,9 +228,9 @@ class ViewControllerTest extends TestCase {
->willReturn($baseFolderTrash);
$baseFolderFiles->expects($this->any())
- ->method('getById')
+ ->method('getFirstNodeById')
->with(123)
- ->willReturn([]);
+ ->willReturn(null);
$node = $this->getMockBuilder(File::class)->getMock();
$node->expects($this->once())
@@ -238,9 +238,9 @@ class ViewControllerTest extends TestCase {
->willReturn($parentNode);
$baseFolderTrash->expects($this->once())
- ->method('getById')
+ ->method('getFirstNodeById')
->with(123)
- ->willReturn([$node]);
+ ->willReturn($node);
$baseFolderTrash->expects($this->once())
->method('getRelativePath')
->with('testuser1/files_trashbin/files/test.d1462861890/sub')