Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
Signed-off-by: Git'Fellow <[email protected]>
  • Loading branch information
solracsf authored Sep 5, 2024
1 parent 0e0c78c commit 3cd9e0f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/lib/Files/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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();
Expand Down

0 comments on commit 3cd9e0f

Please sign in to comment.