Skip to content

Commit 26e0887

Browse files
committed
test: adjust tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent f9c6745 commit 26e0887

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

apps/files_sharing/lib/Updater.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use OCP\Constants;
1414
use OCP\Files\Folder;
1515
use OCP\Files\Mount\IMountManager;
16+
use OCP\Files\NotFoundException;
1617
use OCP\Server;
1718
use OCP\Share\IShare;
1819

@@ -48,7 +49,11 @@ private static function moveShareInOrOutOfShare($path): void {
4849
throw new \Exception('user folder has no owner');
4950
}
5051

51-
$src = $userFolder->get($path);
52+
try {
53+
$src = $userFolder->get($path);
54+
} catch (NotFoundException) {
55+
return;
56+
}
5257

5358
$shareManager = Server::get(\OCP\Share\IManager::class);
5459

tests/lib/Files/ViewTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,10 +1565,15 @@ private function createTestMovableMountPoints($mountPoints) {
15651565
return new \OC\Files\Cache\Storage($storage, true, Server::get(IDBConnection::class));
15661566
});
15671567

1568-
$mounts[] = $this->getMockBuilder(TestMoveableMountPoint::class)
1569-
->onlyMethods(['moveMount'])
1568+
$mount = $this->getMockBuilder(TestMoveableMountPoint::class)
1569+
->onlyMethods(['moveMount', 'getNumericStorageId'])
15701570
->setConstructorArgs([$storage, $mountPoint])
15711571
->getMock();
1572+
1573+
$mount->method('getNumericStorageId')
1574+
->willReturn(1);
1575+
1576+
$mounts[] = $mount;
15721577
}
15731578

15741579
/** @var IMountProvider|\PHPUnit\Framework\MockObject\MockObject $mountProvider */

0 commit comments

Comments
 (0)