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
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit')
-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',