mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 01:00:50 -04:00
test: adjust tests for updated local backend check
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
620b5c3347
commit
d80a2a88e5
3 changed files with 20 additions and 2 deletions
|
|
@ -49,7 +49,8 @@ class GlobalStoragesControllerTest extends StoragesControllerTest {
|
|||
$this->createMock(LoggerInterface::class),
|
||||
$session,
|
||||
$this->createMock(IGroupManager::class),
|
||||
$config
|
||||
$config,
|
||||
$this->backendService,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,10 +9,12 @@ namespace OCA\Files_External\Tests\Controller;
|
|||
use OCA\Files_External\Controller\GlobalStoragesController;
|
||||
use OCA\Files_External\Lib\Auth\AuthMechanism;
|
||||
use OCA\Files_External\Lib\Backend\Backend;
|
||||
use OCA\Files_External\Lib\Backend\Local;
|
||||
use OCA\Files_External\Lib\StorageConfig;
|
||||
|
||||
use OCA\Files_External\MountConfig;
|
||||
use OCA\Files_External\NotFoundException;
|
||||
use OCA\Files_External\Service\BackendService;
|
||||
use OCA\Files_External\Service\GlobalStoragesService;
|
||||
use OCA\Files_External\Service\UserStoragesService;
|
||||
use OCP\AppFramework\Http;
|
||||
|
|
@ -29,9 +31,23 @@ abstract class StoragesControllerTest extends \Test\TestCase {
|
|||
* @var GlobalStoragesService|UserStoragesService|MockObject
|
||||
*/
|
||||
protected $service;
|
||||
/**
|
||||
* @var BackendService|MockObject
|
||||
*/
|
||||
protected $backendService;
|
||||
|
||||
protected function setUp(): void {
|
||||
MountConfig::$skipTest = true;
|
||||
|
||||
$this->backendService = $this->createMock(BackendService::class);
|
||||
$this->backendService->method('getBackend')
|
||||
->willReturnCallback(function ($identifier) {
|
||||
if ($identifier === 'local') {
|
||||
return $this->createMock(Local::class);
|
||||
} else {
|
||||
return $this->createMock(Backend::class);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function tearDown(): void {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ class UserStoragesControllerTest extends StoragesControllerTest {
|
|||
$this->createMock(LoggerInterface::class),
|
||||
$session,
|
||||
$this->createMock(IGroupManager::class),
|
||||
$config
|
||||
$config,
|
||||
$this->backendService,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue