Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-01-30 15:30:45 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2020-01-31 00:06:28 +0300
commitc9253cce6cacedc19dbb04d8dd89a3da1473ef20 (patch)
tree7f4b8e715d6c402a1ce7dcfadcc7bae0db43ef53 /tests/lib/Settings
parentdc1979903ef4c88ad0ae06b40386e2fa339837c2 (diff)
Move personal settings to proper registration
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/lib/Settings')
-rw-r--r--tests/lib/Settings/ManagerTest.php25
1 files changed, 15 insertions, 10 deletions
diff --git a/tests/lib/Settings/ManagerTest.php b/tests/lib/Settings/ManagerTest.php
index 7972a4bdbba..06eafb6528b 100644
--- a/tests/lib/Settings/ManagerTest.php
+++ b/tests/lib/Settings/ManagerTest.php
@@ -24,15 +24,14 @@
namespace OCA\Settings\Tests\AppInfo;
use OC\Settings\Manager;
-use OC\Settings\Section;
use OCA\Settings\Admin\Sharing;
-use OCA\Settings\Personal\Password;
use OCP\IDBConnection;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IServerContainer;
use OCP\IURLGenerator;
use OCP\L10N\IFactory;
+use OCP\Settings\ISettings;
use OCP\Settings\ISubAdminSettings;
use Test\TestCase;
@@ -149,21 +148,27 @@ class ManagerTest extends TestCase {
}
public function testGetPersonalSettings() {
- $section = $this->createMock(Password::class);
- $section->expects($this->once())
- ->method('getPriority')
+ $section = $this->createMock(ISettings::class);
+ $section->method('getPriority')
->willReturn(16);
- $section2 = $this->createMock(Security\Authtokens::class);
- $section2->expects($this->once())
- ->method('getPriority')
+ $section->method('getSection')
+ ->willReturn('security');
+ $section2 = $this->createMock(ISettings::class);
+ $section2->method('getPriority')
->willReturn(100);
+ $section2->method('getSection')
+ ->willReturn('security');
+
+ $this->manager->registerSetting('personal', 'section1');
+ $this->manager->registerSetting('personal', 'section2');
+
$this->container->expects($this->at(0))
->method('query')
- ->with(Password::class)
+ ->with('section1')
->willReturn($section);
$this->container->expects($this->at(1))
->method('query')
- ->with(Security\Authtokens::class)
+ ->with('section2')
->willReturn($section2);
$settings = $this->manager->getPersonalSettings('security');