summaryrefslogtreecommitdiffstats
path: root/tests/lib/Accounts/AccountManagerTest.php
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2021-05-12 14:17:50 +0200
committerGitHub <noreply@github.com>2021-05-12 14:17:50 +0200
commit7e1c842d96cde01ebb6854b3e28fb998006575b2 (patch)
tree0da4f083e0db25a76c59c9d93d869fcf08809c23 /tests/lib/Accounts/AccountManagerTest.php
parent6c741724fbdfc71762407298738c330e5ceb9b88 (diff)
parent8413ed947577a37c79ceebfc827acd37494d1a37 (diff)
downloadnextcloud-server-7e1c842d96cde01ebb6854b3e28fb998006575b2.tar.gz
nextcloud-server-7e1c842d96cde01ebb6854b3e28fb998006575b2.zip
Merge pull request #26923 from nextcloud/techdebt/noid/provapi-no-private-accountmanager
provisioning API to use only public API of IAccountManager
Diffstat (limited to 'tests/lib/Accounts/AccountManagerTest.php')
-rw-r--r--tests/lib/Accounts/AccountManagerTest.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/lib/Accounts/AccountManagerTest.php b/tests/lib/Accounts/AccountManagerTest.php
index 687ae29ff7b..1da128ae124 100644
--- a/tests/lib/Accounts/AccountManagerTest.php
+++ b/tests/lib/Accounts/AccountManagerTest.php
@@ -213,8 +213,8 @@ class AccountManagerTest extends TestCase {
// SCOPE_PRIVATE is not allowed for display name and email
IAccountManager::PROPERTY_DISPLAYNAME => ['value' => 'Display Name', 'scope' => IAccountManager::SCOPE_PRIVATE],
IAccountManager::PROPERTY_EMAIL => ['value' => 'test@example.org', 'scope' => IAccountManager::SCOPE_PRIVATE],
- IAccountManager::PROPERTY_TWITTER => ['value' => '@sometwitter', 'scope' => 'invalid'],
- IAccountManager::PROPERTY_PHONE => ['value' => '+491601231212', 'scope' => ''],
+ IAccountManager::PROPERTY_TWITTER => ['value' => '@sometwitter', 'scope' => IAccountManager::SCOPE_LOCAL],
+ IAccountManager::PROPERTY_PHONE => ['value' => '+491601231212', 'scope' => IAccountManager::SCOPE_LOCAL],
],
[
IAccountManager::PROPERTY_DISPLAYNAME => ['value' => 'Display Name', 'scope' => IAccountManager::SCOPE_LOCAL],
@@ -222,9 +222,23 @@ class AccountManagerTest extends TestCase {
IAccountManager::PROPERTY_TWITTER => ['value' => '@sometwitter', 'scope' => IAccountManager::SCOPE_LOCAL],
IAccountManager::PROPERTY_PHONE => ['value' => '+491601231212', 'scope' => IAccountManager::SCOPE_LOCAL],
],
- // don't throw but fall back
false, false,
],
+ // illegal scope values
+ [
+ [
+ IAccountManager::PROPERTY_PHONE => ['value' => '+491601231212', 'scope' => IAccountManager::SCOPE_FEDERATED],
+ IAccountManager::PROPERTY_ADDRESS => ['value' => 'some street', 'scope' => IAccountManager::SCOPE_LOCAL],
+ IAccountManager::PROPERTY_WEBSITE => ['value' => 'https://example.org', 'scope' => IAccountManager::SCOPE_PRIVATE],
+ ],
+ [
+ IAccountManager::PROPERTY_PHONE => ['value' => '+491601231212', 'scope' => ''],
+ IAccountManager::PROPERTY_ADDRESS => ['value' => 'some street', 'scope' => 'v2-invalid'],
+ IAccountManager::PROPERTY_WEBSITE => ['value' => 'https://example.org', 'scope' => 'invalid'],
+ ],
+ [],
+ true, true
+ ],
// invalid or unsupported scope values throw an exception when passing $throwOnData=true
[
[IAccountManager::PROPERTY_DISPLAYNAME => ['value' => 'Display Name', 'scope' => IAccountManager::SCOPE_PUBLISHED]],