diff --git a/apps/files/tests/Command/ScanAppDataTest.php b/apps/files/tests/Command/ScanAppDataTest.php index ddbb289c0f4..cdba710c2c8 100644 --- a/apps/files/tests/Command/ScanAppDataTest.php +++ b/apps/files/tests/Command/ScanAppDataTest.php @@ -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');