aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Accounts
Commit message (Collapse)AuthorAgeFilesLines
* fix(AccountManager): Sanitize social media handlesFerdinand Thiessen2025-02-061-50/+200
| | | | | | Ensure to only accept valid X and fediverse handles. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix(settings): pronouns UsersControllerTestJohn Molakvoæ (skjnldsv)2024-09-181-0/+6
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* refactor: Add void return type to PHPUnit test methodsChristoph Wurst2024-09-155-25/+25
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-251-2/+2
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* feat(ldap): sync additional properties to profile and SABJake Nabasny2024-05-301-0/+6
| | | | | | | | | | | | | | | Synced from LDAP to profile: - Date of birth Synced from LDAP to SAB (via the profile): - Biography - Date of birth Original code by Jake Nabasny (GitHub: @slapcat) Co-authored-by: Jake Nabasny <jake@nabasny.com> Co-authored-by: Richard Steinmetz <richard@steinmetz.cloud> Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
* chore: Add SPDX headerAndy Scherzinger2024-05-135-93/+11
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix: Apply new coding standard to all filesCôme Chilliet2024-04-021-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(phonenumber): Use the newly introduced API to limit 3rdparty lib usageJoas Schilling2023-09-251-2/+9
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* feat!: Migrate AccountManager event to typed eventJoas Schilling2023-07-281-11/+10
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* composer run cs:fixCôme Chilliet2023-01-201-1/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix testsCarl Schwan2022-11-221-0/+39
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Allow to tweak default scopes for accountsThomas Citharel2022-05-161-33/+71
| | | | | | Close #6582 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Minor optimizations for saving user personal informationCarl Schwan2022-05-121-6/+3
| | | | | | | | | | | | | | | | * Remove double hook: the OC_User::changeUser triggers an OC\AccountManager::userUpdated and the app is already listening to this signal in its Application definition * Make createCard not check if an card exists if we already checked previously. We also don't try to get the card if the user is disabled as we don't use the card in this case We this change we go from 100 DB requests to 80 DB requests when saving an user email address. Signed-off-by: Carl Schwan <carl@carlschwan.eu> (cherry picked from commit c6fd482edf33214a9ad4787e4cac278f871fa7c8)
* Add profile default setting for adminChristopher Ng2022-03-181-0/+6
| | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* Add method to set all account properties from jsonChristopher Ng2022-03-171-0/+25
| | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* Discard duplicate collection name from account serializationChristopher Ng2022-03-171-1/+15
| | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* Fix testJoas Schilling2022-01-111-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix email verificationChristopher Ng2022-01-061-0/+39
| | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* fix populating account array with missing default valuesArthur Schiwon2021-10-221-9/+7
| | | | | | | | - both $userData and $defaultUserData have numeric indices - each element contains at least the name and other fields - appending the missing data array is sufficient Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Merge pull request #26725 from ↵John Molakvoæ2021-10-221-0/+1
|\ | | | | | | nextcloud/fix-federated-scope-not-shown-when-public-addressbook-upload-is-disabled
| * Add missing scope to testDaniel Calviño Sánchez2021-08-181-0/+1
| | | | | | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Add new account propertiesChristopher Ng2021-10-191-6/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - New properties - Organisation - Role - Headline - Biography - Profile Enabled property - Fix errors with building default account properties - Fix L10N factory method `getLanguage` not public error - Update tests Signed-off-by: Christopher Ng <chrng8@gmail.com>
* | implement verification for additional mailsArthur Schiwon2021-09-091-0/+36
|/ | | | | | | | | | | | - mails added by (sub)admins are automatically verified - provisioning_api controller as verification endpoint - IAccountProperty gets a locallyVerified property - IPropertyCollection gets a method to fetch an IAccountProperty by value - an remove equivalent was already present - AccountManager always initiates mail verification on update if necessary - add core success template for arbitrary title and message Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* adjust internal data handling logic to fix store and loadArthur Schiwon2021-06-301-146/+109
| | | | | | - format as stored previously in oc_accounts table is kept Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* adjust email verification checkerArthur Schiwon2021-06-301-4/+1
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* adjust verification state updater methodArthur Schiwon2021-06-301-10/+5
| | | | | | - also fixes scope of internal methods Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* make AccountManager actually write multi value propertiesArthur Schiwon2021-06-301-163/+106
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* accounts event handler to use eventdispatcher, DI and Accounts APIArthur Schiwon2021-06-301-42/+42
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* prov api reports additional emails on getUserArthur Schiwon2021-06-301-0/+1
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* CI: more flexible assertionsArthur Schiwon2021-06-071-1/+6
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* allow interacting with IAccountPropertyCollectionsArthur Schiwon2021-06-031-3/+24
| | | | | | | | | | | | | - in fact the API could be done in a nicer way and it might be possible to work without IAccountPropertyCollection, but only with the IAccountProperties. - To keep it simple at first and not overengineer the blunt attempt is followed - If necessary helpful in the further cause of development adjustements or extensions can be done quickly with this base Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* add IAccountPropertyCollection with implementationArthur Schiwon2021-06-031-0/+209
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* update unit testsArthur Schiwon2021-06-031-16/+166
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* do not use private AccountManager in UsersControllerArthur Schiwon2021-05-253-18/+40
| | | | | | | | - extends IAccountProperty for verificationData getters and setters - implementation thereof ^ - and of course adaption of UsersController Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* allow to set valid scopes only in AccountPropertyArthur Schiwon2021-05-122-7/+25
| | | | | | the auto-fallback to v2-local is removed as well to react on wrong input Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Validate the website field input to be a valid URLJoas Schilling2021-04-221-0/+26
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add property scope tests for AccountManagerVincent Petry2021-03-261-0/+123
| | | | Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Map old account scope properties to new namesVincent Petry2021-03-263-34/+63
| | | | | | | | Use new scope values in settings page. Adjust all consumers to use the new constants. Map old scope values to new ones in account property getter. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Fix Test class nameJoas Schilling2021-03-121-2/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add and fix unit testsJoas Schilling2020-12-071-6/+45
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Make code strictJoas Schilling2020-12-071-14/+15
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Don't leave cursors open when tests failJoas Schilling2020-11-091-1/+4
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* PSR logger for accountsJoas Schilling2020-10-202-8/+9
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to ↵Morris Jobke2020-08-121-3/+3
| | | | | | \PHPUnit\Framework\MockObject\MockObject Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-104-14/+2
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use exactly one empty line after the namespace declarationChristoph Wurst2020-04-092-2/+0
| | | | | | For PSR2 Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix (array) indent style to always use one tabChristoph Wurst2020-04-091-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Log critical fallback to user default if we can't parse the JSONChristoph Wurst2019-12-131-7/+12
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Mode to modern phpunitRoeland Jago Douma2019-11-272-3/+3
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-272-3/+3
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>