summaryrefslogtreecommitdiffstats
path: root/apps/settings/tests/Settings
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2021-07-22 11:41:29 +0200
committerCarl Schwan <carl@carlschwan.eu>2021-09-29 21:43:31 +0200
commit6958d8005ae3b86759f49746564bf7238456be52 (patch)
treeaab851e09351c631129e4729aa49c03533ce6180 /apps/settings/tests/Settings
parentee987d74303cb38b864f96660cd2ee6d6552ebfd (diff)
downloadnextcloud-server-6958d8005ae3b86759f49746564bf7238456be52.tar.gz
nextcloud-server-6958d8005ae3b86759f49746564bf7238456be52.zip
Add admin privilege delegation for admin settings
This makes it possible for selected groups to access some settings pages. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/settings/tests/Settings')
-rw-r--r--apps/settings/tests/Settings/Admin/MailTest.php7
-rw-r--r--apps/settings/tests/Settings/Admin/ServerTest.php5
2 files changed, 11 insertions, 1 deletions
diff --git a/apps/settings/tests/Settings/Admin/MailTest.php b/apps/settings/tests/Settings/Admin/MailTest.php
index b346089e3d4..5fd3f1600c5 100644
--- a/apps/settings/tests/Settings/Admin/MailTest.php
+++ b/apps/settings/tests/Settings/Admin/MailTest.php
@@ -31,6 +31,7 @@ namespace OCA\Settings\Tests\Settings\Admin;
use OCA\Settings\Settings\Admin\Mail;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
+use OCP\IL10N;
use Test\TestCase;
class MailTest extends TestCase {
@@ -38,13 +39,17 @@ class MailTest extends TestCase {
private $admin;
/** @var IConfig */
private $config;
+ /** @var IL10N */
+ private $l10n;
protected function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
+ $this->l10n = $this->getMockBuilder(IL10N::class)->getMock();
$this->admin = new Mail(
- $this->config
+ $this->config,
+ $this->l10n
);
}
diff --git a/apps/settings/tests/Settings/Admin/ServerTest.php b/apps/settings/tests/Settings/Admin/ServerTest.php
index c1448c9e987..b30ed863f89 100644
--- a/apps/settings/tests/Settings/Admin/ServerTest.php
+++ b/apps/settings/tests/Settings/Admin/ServerTest.php
@@ -36,6 +36,7 @@ use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IConfig;
use OCP\IDBConnection;
+use OCP\IL10N;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
@@ -51,12 +52,15 @@ class ServerTest extends TestCase {
private $timeFactory;
/** @var IConfig|MockObject */
private $config;
+ /** @var IL10N|MockObject */
+ private $l10n;
protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
$this->timeFactory = $this->createMock(ITimeFactory::class);
$this->config = $this->createMock(IConfig::class);
+ $this->l10n = $this->createMock(IL10N::class);
$this->admin = $this->getMockBuilder(Server::class)
->onlyMethods(['cronMaxAge'])
@@ -64,6 +68,7 @@ class ServerTest extends TestCase {
$this->connection,
$this->timeFactory,
$this->config,
+ $this->l10n,
])
->getMock();
}