summaryrefslogtreecommitdiffstats
path: root/apps/settings/tests
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2022-03-17 18:06:38 +0000
committerChristopher Ng <chrng8@gmail.com>2022-03-18 02:55:12 +0000
commit108abd77ed0ee29bca4019f6a212ba1b2bdad5e7 (patch)
tree3c2d3f2382b83eb93cae4f974d20bbbbe2b9789b /apps/settings/tests
parent1fc0b4320c8921ad59bf4d41a88bf9936e1f653d (diff)
downloadnextcloud-server-108abd77ed0ee29bca4019f6a212ba1b2bdad5e7.tar.gz
nextcloud-server-108abd77ed0ee29bca4019f6a212ba1b2bdad5e7.zip
Add profile default setting for admin
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'apps/settings/tests')
-rw-r--r--apps/settings/tests/Settings/Admin/ServerTest.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/settings/tests/Settings/Admin/ServerTest.php b/apps/settings/tests/Settings/Admin/ServerTest.php
index 045dc60bf98..acabf9abf5e 100644
--- a/apps/settings/tests/Settings/Admin/ServerTest.php
+++ b/apps/settings/tests/Settings/Admin/ServerTest.php
@@ -31,8 +31,10 @@ declare(strict_types=1);
*/
namespace OCA\Settings\Tests\Settings\Admin;
+use OC\Profile\ProfileManager;
use OCA\Settings\Settings\Admin\Server;
use OCP\AppFramework\Http\TemplateResponse;
+use OCP\AppFramework\Services\IInitialState;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IConfig;
use OCP\IDBConnection;
@@ -48,6 +50,10 @@ class ServerTest extends TestCase {
private $admin;
/** @var IDBConnection */
private $connection;
+ /** @var IInitialState */
+ private $initialStateService;
+ /** @var ProfileManager */
+ private $profileManager;
/** @var ITimeFactory|MockObject */
private $timeFactory;
/** @var IConfig|MockObject */
@@ -58,6 +64,8 @@ class ServerTest extends TestCase {
protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
+ $this->initialStateService = $this->createMock(IInitialState::class);
+ $this->profileManager = $this->createMock(ProfileManager::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
$this->config = $this->createMock(IConfig::class);
$this->l10n = $this->createMock(IL10N::class);
@@ -66,6 +74,8 @@ class ServerTest extends TestCase {
->onlyMethods(['cronMaxAge'])
->setConstructorArgs([
$this->connection,
+ $this->initialStateService,
+ $this->profileManager,
$this->timeFactory,
$this->config,
$this->l10n,
@@ -106,6 +116,7 @@ class ServerTest extends TestCase {
'cronMaxAge' => 1337,
'cli_based_cron_possible' => true,
'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : '', // to not explode here because of posix extension not being disabled - which is already checked in the line above
+ 'profileEnabledGlobally' => true,
],
''
);