From 3cd9e0f61e2c986a2b79fba1eaee408c857b1f4c Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Thu, 5 Sep 2024 08:39:28 +0200 Subject: [PATCH] fix: tests Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- tests/lib/Files/ViewTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index 773a20ab2ae52..3a1fbcffb303b 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -1668,20 +1668,24 @@ public function testMoveMountPointIntoAnother() { public function testMoveMountPointIntoSharedFolder() { self::loginAsUser($this->user); - [$mount1] = $this->createTestMovableMountPoints([ + [$mount1, $mount2] = $this->createTestMovableMountPoints([ $this->user . '/files/mount1', + $this->user . '/files/mount2', ]); $mount1->expects($this->never()) ->method('moveMount'); + $mount2->expects($this->once()) + ->method('moveMount') + ->willReturn(true); + $view = new View('/' . $this->user . '/files/'); $view->mkdir('shareddir'); $view->mkdir('shareddir/sub'); $view->mkdir('shareddir/sub2'); // Create a similar named but non-shared folder $view->mkdir('shareddir notshared'); - $view->mkdir('shareddir notshared/sub'); $fileId = $view->getFileInfo('shareddir')->getId(); $userObject = \OC::$server->getUserManager()->createUser('test2', 'IHateNonMockableStaticClasses'); @@ -1700,8 +1704,7 @@ public function testMoveMountPointIntoSharedFolder() { $this->assertFalse($view->rename('mount1', 'shareddir'), 'Cannot overwrite shared folder'); $this->assertFalse($view->rename('mount1', 'shareddir/sub'), 'Cannot move mount point into shared folder'); $this->assertFalse($view->rename('mount1', 'shareddir/sub/sub2'), 'Cannot move mount point into shared subfolder'); - $this->assertTrue($view->rename('mount1', 'shareddir notshared'), 'Can move mount point into a similarly named but non-shared folder'); - $this->assertTrue($view->rename('mount1', 'shareddir notshared/sub'), 'Can move mount point into a similarly named but non-shared subfolder'); + $this->assertTrue($view->rename('mount2', 'shareddir notshared'), 'Can move mount point into a similarly named but non-shared folder'); $shareManager->deleteShare($share); $userObject->delete();