aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Settings/ManagerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Settings/ManagerTest.php')
-rw-r--r--tests/lib/Settings/ManagerTest.php27
1 files changed, 13 insertions, 14 deletions
diff --git a/tests/lib/Settings/ManagerTest.php b/tests/lib/Settings/ManagerTest.php
index 90c195e6bd0..91277cc7f1e 100644
--- a/tests/lib/Settings/ManagerTest.php
+++ b/tests/lib/Settings/ManagerTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -8,6 +9,7 @@ namespace OC\Settings\Tests\AppInfo;
use OC\Settings\AuthorizedGroupMapper;
use OC\Settings\Manager;
+use OCA\WorkflowEngine\Settings\Section;
use OCP\Group\ISubAdmin;
use OCP\IDBConnection;
use OCP\IGroupManager;
@@ -15,6 +17,7 @@ use OCP\IL10N;
use OCP\IServerContainer;
use OCP\IURLGenerator;
use OCP\L10N\IFactory;
+use OCP\Server;
use OCP\Settings\ISettings;
use OCP\Settings\ISubAdminSettings;
use PHPUnit\Framework\MockObject\MockObject;
@@ -65,11 +68,11 @@ class ManagerTest extends TestCase {
}
public function testGetAdminSections(): void {
- $this->manager->registerSection('admin', \OCA\WorkflowEngine\Settings\Section::class);
+ $this->manager->registerSection('admin', Section::class);
- $section = \OC::$server->query(\OCA\WorkflowEngine\Settings\Section::class);
+ $section = Server::get(Section::class);
$this->container->method('get')
- ->with(\OCA\WorkflowEngine\Settings\Section::class)
+ ->with(Section::class)
->willReturn($section);
$this->assertEquals([
@@ -78,11 +81,11 @@ class ManagerTest extends TestCase {
}
public function testGetPersonalSections(): void {
- $this->manager->registerSection('personal', \OCA\WorkflowEngine\Settings\Section::class);
+ $this->manager->registerSection('personal', Section::class);
- $section = \OC::$server->query(\OCA\WorkflowEngine\Settings\Section::class);
+ $section = Server::get(Section::class);
$this->container->method('get')
- ->with(\OCA\WorkflowEngine\Settings\Section::class)
+ ->with(Section::class)
->willReturn($section);
$this->assertEquals([
@@ -178,10 +181,6 @@ class ManagerTest extends TestCase {
$this->container->expects($this->exactly(2))
->method('get')
- ->withConsecutive(
- ['section1'],
- ['section2']
- )
->willReturnMap([
['section1', $section],
['section2', $section2],
@@ -206,13 +205,13 @@ class ManagerTest extends TestCase {
->method('t')
->willReturnArgument(0);
- $this->manager->registerSection('personal', \OCA\WorkflowEngine\Settings\Section::class);
- $this->manager->registerSection('admin', \OCA\WorkflowEngine\Settings\Section::class);
+ $this->manager->registerSection('personal', Section::class);
+ $this->manager->registerSection('admin', Section::class);
- $section = \OC::$server->query(\OCA\WorkflowEngine\Settings\Section::class);
+ $section = Server::get(Section::class);
$this->container->method('get')
- ->with(\OCA\WorkflowEngine\Settings\Section::class)
+ ->with(Section::class)
->willReturn($section);
$this->assertEquals([