test: adjust tests

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2026-01-15 12:57:46 +01:00
parent 43a9335355
commit 94f33463ff
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB
2 changed files with 13 additions and 3 deletions

View file

@ -13,6 +13,7 @@ use OC\Files\Mount\MountPoint;
use OCP\Constants;
use OCP\Files\Folder;
use OCP\Files\Mount\IMountManager;
use OCP\Files\NotFoundException;
use OCP\Server;
use OCP\Share\IShare;
@ -48,7 +49,11 @@ class Updater {
throw new \Exception('user folder has no owner');
}
$src = $userFolder->get($path);
try {
$src = $userFolder->get($path);
} catch (NotFoundException) {
return;
}
$shareManager = Server::get(\OCP\Share\IManager::class);

View file

@ -1565,10 +1565,15 @@ class ViewTest extends \Test\TestCase {
return new \OC\Files\Cache\Storage($storage, true, Server::get(IDBConnection::class));
});
$mounts[] = $this->getMockBuilder(TestMoveableMountPoint::class)
->onlyMethods(['moveMount'])
$mount = $this->getMockBuilder(TestMoveableMountPoint::class)
->onlyMethods(['moveMount', 'getNumericStorageId'])
->setConstructorArgs([$storage, $mountPoint])
->getMock();
$mount->method('getNumericStorageId')
->willReturn(1);
$mounts[] = $mount;
}
/** @var IMountProvider|\PHPUnit\Framework\MockObject\MockObject $mountProvider */