diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-03-19 16:01:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-19 16:01:07 +0300 |
commit | 82102c6f18d003fc2752014152b79f78d77869c3 (patch) | |
tree | da8101a74623e22918b2d3075fd63e4d42b2eb4a /tests/unit | |
parent | 1df4ef8f2beac00e75e76bce495efc8f409c312c (diff) | |
parent | 02cde8030b9381c586fd42613fd170eab2b0ab37 (diff) |
Merge pull request #196 from nextcloud/multiple-user-back-ends
Multiple user back ends
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/AppInfo/RoutesTest.php | 5 | ||||
-rw-r--r-- | tests/unit/Controller/SAMLControllerTest.php | 23 | ||||
-rw-r--r-- | tests/unit/Settings/AdminTest.php | 9 |
3 files changed, 37 insertions, 0 deletions
diff --git a/tests/unit/AppInfo/RoutesTest.php b/tests/unit/AppInfo/RoutesTest.php index 0ddf2335..ed52025e 100644 --- a/tests/unit/AppInfo/RoutesTest.php +++ b/tests/unit/AppInfo/RoutesTest.php @@ -59,6 +59,11 @@ class Test extends TestCase { 'url' => '/saml/error', 'verb' => 'GET', ], + [ + 'name' => 'SAML#selectUserBackEnd', + 'url' => '/saml/selectUserBackEnd', + 'verb' => 'GET', + ], ], ]; $this->assertSame($expected, $routes); diff --git a/tests/unit/Controller/SAMLControllerTest.php b/tests/unit/Controller/SAMLControllerTest.php index def38c1f..f2ae402f 100644 --- a/tests/unit/Controller/SAMLControllerTest.php +++ b/tests/unit/Controller/SAMLControllerTest.php @@ -458,4 +458,27 @@ class SAMLControllerTest extends TestCase { ['messageSend' => 'test message', 'messageExpected' => 'test message'], ]; } + + /** + * @dataProvider dataTestGetSSODisplayName + * + * @param string $configuredDisplayName + * @param string $expected + */ + public function testGetSSODisplayName($configuredDisplayName, $expected) { + $this->config->expects($this->any())->method('getAppValue') + ->with('user_saml', 'general-idp0_display_name') + ->willReturn($configuredDisplayName); + + $result = $this->invokePrivate($this->samlController, 'getSSODisplayName'); + + $this->assertSame($expected, $result); + } + + public function dataTestGetSSODisplayName() { + return [ + ['My identity provider', 'My identity provider'], + ['', 'SSO & SAML log in'] + ]; + } } diff --git a/tests/unit/Settings/AdminTest.php b/tests/unit/Settings/AdminTest.php index 449f7189..e42ebcd9 100644 --- a/tests/unit/Settings/AdminTest.php +++ b/tests/unit/Settings/AdminTest.php @@ -81,6 +81,11 @@ class AdminTest extends \Test\TestCase { 'lowercaseUrlencoding' => 'ADFS URL-Encodes SAML data as lowercase, and the toolkit by default uses uppercase. Enable for ADFS compatibility on signature verification.', ]; $generalSettings = [ + 'idp0_display_name' => [ + 'text' => $this->l10n->t('Optional display name of the identity provider (default: "SSO & SAML log in")'), + 'type' => 'line', + 'required' => false, + ], 'uid_mapping' => [ 'text' => 'Attribute to map the UID to.', 'type' => 'line', @@ -94,6 +99,10 @@ class AdminTest extends \Test\TestCase { 'text' => 'Use SAML auth for the Nextcloud desktop clients (requires user re-authentication)', 'type' => 'checkbox', ], + 'allow_multiple_user_back_ends' => [ + 'text' => $this->l10n->t('Allow the use of multiple user back-ends (e.g. LDAP)'), + 'type' => 'checkbox', + ], ]; $attributeMappingSettings = [ 'displayName_mapping' => [ |