diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2020-01-30 13:30:45 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-01-30 22:06:28 +0100 |
commit | c9253cce6cacedc19dbb04d8dd89a3da1473ef20 (patch) | |
tree | 7f4b8e715d6c402a1ce7dcfadcc7bae0db43ef53 /tests | |
parent | dc1979903ef4c88ad0ae06b40386e2fa339837c2 (diff) | |
download | nextcloud-server-c9253cce6cacedc19dbb04d8dd89a3da1473ef20.tar.gz nextcloud-server-c9253cce6cacedc19dbb04d8dd89a3da1473ef20.zip |
Move personal settings to proper registration
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Settings/ManagerTest.php | 25 |
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'); |