diff --git a/apps/files_external/lib/Settings/Admin.php b/apps/files_external/lib/Settings/Admin.php index c3f8e175c72f5..2776fae214fac 100644 --- a/apps/files_external/lib/Settings/Admin.php +++ b/apps/files_external/lib/Settings/Admin.php @@ -14,9 +14,10 @@ use OCP\AppFramework\Services\IInitialState; use OCP\Encryption\IManager; use OCP\IURLGenerator; -use OCP\Settings\ISettings; +use OCP\IL10N; +use OCP\Settings\IDelegatedSettings; -class Admin implements ISettings { +class Admin implements IDelegatedSettings { use CommonSettingsTrait; public function __construct( @@ -26,6 +27,7 @@ public function __construct( private GlobalAuth $globalAuth, private IInitialState $initialState, private IURLGenerator $urlGenerator, + private IL10N $l10n, ) { $this->visibility = BackendService::VISIBILITY_ADMIN; } @@ -65,4 +67,12 @@ public function getSection() { public function getPriority() { return 40; } + + public function getName(): string { + return $this->l10n->t('External storage'); + } + + public function getAuthorizedAppConfig(): array { + return []; + } } diff --git a/apps/files_external/tests/Settings/AdminTest.php b/apps/files_external/tests/Settings/AdminTest.php index 07f4e2df2b4c9..6e508bf92f884 100644 --- a/apps/files_external/tests/Settings/AdminTest.php +++ b/apps/files_external/tests/Settings/AdminTest.php @@ -12,10 +12,10 @@ use OCA\Files_External\Service\BackendService; use OCA\Files_External\Service\GlobalStoragesService; use OCA\Files_External\Settings\Admin; -use OCP\App\IAppManager; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; use OCP\Encryption\IManager; +use OCP\IL10N; use OCP\IURLGenerator; use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; @@ -27,7 +27,7 @@ class AdminTest extends TestCase { private GlobalAuth&MockObject $globalAuth; private IInitialState&MockObject $initialState; private IURLGenerator&MockObject $urlGenerator; - private IAppManager&MockObject $appManager; + private IL10N&MockObject $l10n; private Admin $admin; protected function setUp(): void { @@ -38,7 +38,10 @@ protected function setUp(): void { $this->globalAuth = $this->createMock(GlobalAuth::class); $this->initialState = $this->createMock(IInitialState::class); $this->urlGenerator = $this->createMock(IURLGenerator::class); - $this->appManager = $this->createMock(IAppManager::class); + $this->l10n = $this->createMock(IL10N::class); + $this->l10n->method('t')->willReturnCallback(function ($text) { + return $text; + }); $this->admin = new Admin( $this->encryptionManager, @@ -47,7 +50,7 @@ protected function setUp(): void { $this->globalAuth, $this->initialState, $this->urlGenerator, - $this->appManager, + $this->l10n, ); }