fix: Skip test requiring local storage on object store setup

Signed-off-by: Carl Schwan <carlschwan@kde.org>
This commit is contained in:
Carl Schwan 2026-02-12 00:09:44 +01:00
parent 3d18cd7cc5
commit 89a20598e5
No known key found for this signature in database
GPG key ID: 02325448204E452A

View file

@ -10,6 +10,7 @@ declare(strict_types=1);
namespace OCA\Files\Tests\Command;
use OC\Files\Mount\ObjectHomeMountProvider;
use OC\Files\Utils\Scanner;
use OC\Preview\Db\Preview;
use OC\Preview\Db\PreviewMapper;
@ -22,8 +23,10 @@ use OCP\Files\IMimeTypeLoader;
use OCP\Files\IRootFolder;
use OCP\Files\ISetupManager;
use OCP\Files\NotFoundException;
use OCP\Files\Storage\IStorageFactory;
use OCP\IAppConfig;
use OCP\IConfig;
use OCP\IUser;
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\Server;
@ -91,6 +94,14 @@ class ScanAppDataTest extends TestCase {
}
public function testScanAppDataRoot(): void {
$homeProvider = Server::get(ObjectHomeMountProvider::class);
$user = $this->createMock(IUser::class);
$user->method('getUID')
->willReturn('foo');
if ($homeProvider->getHomeMountForUser($user, $this->createMock(IStorageFactory::class)) !== null) {
$this->markTestSkipped();
}
$this->input->method('getArgument')->with('folder')->willReturn('');
$this->internalScanner->method('scan')->willReturnCallback(function () {
$this->internalScanner->emit('\OC\Files\Utils\Scanner', 'scanFile', ['path42']);
@ -119,6 +130,13 @@ class ScanAppDataTest extends TestCase {
#[DataProvider(methodName: 'scanPreviewLocalData')]
public function testScanAppDataPreviewOnlyLocalFile(bool $migrationDone, ?bool $legacy): void {
$homeProvider = Server::get(ObjectHomeMountProvider::class);
$user = $this->createMock(IUser::class);
$user->method('getUID')
->willReturn('foo');
if ($homeProvider->getHomeMountForUser($user, $this->createMock(IStorageFactory::class)) !== null) {
$this->markTestSkipped();
}
$this->input->method('getArgument')->with('folder')->willReturn('preview');
$file = $this->rootFolder->getUserFolder($this->user)->newFile('myfile.jpeg');