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

github.com/nextcloud/user_saml.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2018-03-19 13:04:11 +0300
committerBjoern Schiessle <bjoern@schiessle.org>2018-03-19 14:51:38 +0300
commit8bc343da6f633738e569e806f7e272eb88f3d7da (patch)
tree80f5711fa0d2109d3617cda37ee83620a4d6e9a7 /tests
parent370594b439c4960af7775dabf2a44cc8965b9be7 (diff)
make display name of SSO identity provider configurable
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/Controller/SAMLControllerTest.php23
-rw-r--r--tests/unit/Settings/AdminTest.php5
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/unit/Controller/SAMLControllerTest.php b/tests/unit/Controller/SAMLControllerTest.php
index d0ad4e0a..199e991d 100644
--- a/tests/unit/Controller/SAMLControllerTest.php
+++ b/tests/unit/Controller/SAMLControllerTest.php
@@ -407,4 +407,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 ea64cbd3..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',