diff options
author | sualko <klaus@jsxc.org> | 2018-08-25 16:48:37 +0200 |
---|---|---|
committer | sualko <klaus@jsxc.org> | 2018-08-25 17:32:19 +0200 |
commit | 61370549f3f86565b73823ff3aba9ba28ec0a8be (patch) | |
tree | e4315cbe480cdb5af0b7a4facfbccdb756a17033 /tests | |
parent | 6099786c8dbd86c0848909108eb2a5572ad7a4bb (diff) | |
download | nextcloud-server-61370549f3f86565b73823ff3aba9ba28ec0a8be.tar.gz nextcloud-server-61370549f3f86565b73823ff3aba9ba28ec0a8be.zip |
Allow same section class for multiple section types (fix #10764)
Signed-off-by: Klaus Herberth <klaus@jsxc.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Settings/ManagerTest.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/lib/Settings/ManagerTest.php b/tests/lib/Settings/ManagerTest.php index df7e59841ce..6f9af39d591 100644 --- a/tests/lib/Settings/ManagerTest.php +++ b/tests/lib/Settings/ManagerTest.php @@ -220,4 +220,45 @@ class ManagerTest extends TestCase { 10 => [new Security($this->userManager)], ], $this->manager->getPersonalSettings('security')); } + + public function testSameSectionAsPersonalAndAdmin() { + $this->l10n + ->expects($this->any()) + ->method('t') + ->will($this->returnArgument(0)); + + $this->manager->registerSection('personal', \OCA\WorkflowEngine\Settings\Section::class); + $this->manager->registerSection('admin', \OCA\WorkflowEngine\Settings\Section::class); + + $this->url->expects($this->exactly(9)) + ->method('imagePath') + ->willReturnMap([ + ['core', 'actions/info.svg', '1'], + ['settings', 'password.svg', '2'], + ['core', 'clients/phone.svg', '3'], + ['settings', 'admin.svg', '0'], + ['core', 'actions/settings-dark.svg', '1'], + ['core', 'actions/share.svg', '2'], + ['core', 'actions/password.svg', '3'], + ['core', 'places/contacts.svg', '5'], + ['settings', 'help.svg', '4'], + ]); + + $this->assertEquals([ + 0 => [new Section('personal-info', 'Personal info', 0, '1')], + 5 => [new Section('security', 'Security', 0, '2')], + 15 => [new Section('sync-clients', 'Mobile & desktop', 0, '3')], + 55 => [\OC::$server->query(\OCA\WorkflowEngine\Settings\Section::class)], + ], $this->manager->getPersonalSections()); + + $this->assertEquals([ + 0 => [new Section('overview', 'Overview', 0, '0')], + 1 => [new Section('server', 'Basic settings', 0, '1')], + 5 => [new Section('sharing', 'Sharing', 0, '2')], + 10 => [new Section('security', 'Security', 0, '3')], + 50 => [new Section('groupware', 'Groupware', 0, '5')], + 55 => [\OC::$server->query(\OCA\WorkflowEngine\Settings\Section::class)], + 98 => [new Section('additional', 'Additional settings', 0, '1')], + ], $this->manager->getAdminSections()); + } } |