summaryrefslogtreecommitdiffstats
path: root/tests/lib/Accounts
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Some php-cs fixesRoeland Jago Douma2019-11-222-2/+0
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Use IAccountManager constantsJulius Härtl2018-10-153-68/+67
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Add tests for new account api classesJulius Härtl2018-10-153-0/+253
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Use ::class in test mocksMorris Jobke2017-10-241-6/+6
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* fix email verification statusBjoern Schiessle2017-04-281-1/+1
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* updated unit testsBjoern Schiessle2017-04-281-6/+50
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Merge pull request #4256 from nextcloud/themingLukas Reschke2017-04-111-1/+0
|\ | | | | Move OC_Defaults to OCP\Defaults
| * Move OC_Defaults to OCP\DefaultsMorris Jobke2017-04-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * currently there are two ways to access default values: OCP\Defaults or OC_Defaults (which is extended by OCA\Theming\ThemingDefaults) * our code used a mixture of both of them, which made it hard to work on theme values * this extended the public interface with the missing methods and uses them everywhere to only rely on the public interface Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Also send the new account data with the eventJoas Schilling2017-04-101-5/+8
|/ | | | Signed-off-by: Joas Schilling <coding@schilljs.com>