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-25 03:53:54 +0000
commitd8c04464aa83d4c22a1ca8d0aa8ffb34e4febb1e (patch)
tree4cb28f2bd5572fc97427fd255d7c353d1a9a856e /apps/settings/tests
parent8bef2ec925824e9e788c1886fe8ea14322f15e9e (diff)
downloadnextcloud-server-d8c04464aa83d4c22a1ca8d0aa8ffb34e4febb1e.tar.gz
nextcloud-server-d8c04464aa83d4c22a1ca8d0aa8ffb34e4febb1e.zip
Add profile default setting for admin
Signed-off-by: Christopher Ng <chrng8@gmail.com> (cherry picked from commit 108abd77ed0ee29bca4019f6a212ba1b2bdad5e7) 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,
],
''
);