mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix: Skip test requiring local storage on object store setup
Signed-off-by: Carl Schwan <carlschwan@kde.org>
This commit is contained in:
parent
3d18cd7cc5
commit
89a20598e5
1 changed files with 18 additions and 0 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue