aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Group
Commit message (Collapse)AuthorAgeFilesLines
* refactor: Add void return type to PHPUnit test methodsChristoph Wurst2024-09-154-56/+56
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-251-3/+3
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* feat(users): Add support for admin delegation for users and groups managementLouis Chemineau2024-07-221-8/+6
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* feat(security): Add public API to allow validating IP Ranges and checking ↵Joas Schilling2024-07-191-3/+3
| | | | | | | for "in range" Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* feat(security): restrict admin actions to IP rangesBenjamin Gaussorgues2024-07-191-31/+36
| | | | Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* Merge pull request #44763 from nextcloud/fix/group_name_length_dbBenjamin Gaussorgues2024-05-162-5/+37
|\
| * fix(groups): allows to save group names with more than 64 charactersBenjamin Gaussorgues2024-04-222-5/+37
| | | | | | | | | | | | Mimic behaviour from LDAP users and add a hard limit to 255 characters Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* | chore: Add SPDX headerAndy Scherzinger2024-05-136-101/+18
|/ | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-2/+2
| | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* Add batch methods in user backendsCarl Schwan2023-09-051-3/+6
| | | | | | This allows for faster group search with significantly less DB traffic Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* fix!: Remove symfony EventDispatcherInterface from GroupJoas Schilling2023-07-272-19/+11
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix!: Remove symfony EventDispatcherInterface from UserJoas Schilling2023-07-272-7/+15
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix tests, and fix Group::searchUsers to avoid duplicatesCôme Chilliet2023-05-022-6/+10
| | | | | | | | Also went back to searchUsers indexing the array by uid as it was the previous behavior and the IGroup phpdoc does not say anything about the keys. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Clear up return typesCôme Chilliet2023-04-271-2/+2
| | | | | | usersInGroup index by int for BC, searchInGroup index by uid (string). Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Optimize retrieving display name when searching for users in a groupCarl Schwan2023-04-272-55/+24
| | | | | | | | | This is recurrent scenario that we are searching for users and then for each users we fetch the displayName. This is inefficient, so instead try to do one query to fetch everything (e.g. Database backend) or use the already existing DisplayNameCache helper. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* composer run cs:fixCôme Chilliet2023-01-202-18/+17
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Add group display name cacheAnna Larch2022-11-281-29/+33
| | | | Signed-off-by: Anna Larch <anna@nextcloud.com>
* Migrate from ILogger to LoggerInterface where needed in the testsCôme Chilliet2022-03-241-3/+3
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix types in the Group ManagerRoeland Jago Douma2021-03-031-0/+3
| | | | | | | | | Psalm found an issue. However the issue found was because of lying docblocks. Fixed those and did some typing to make it all better. For #25839 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Bump nextcloud/coding-standard from 0.3.0 to 0.5.0dependabot-preview[bot]2021-02-181-2/+2
| | | | | | | | | | Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0. - [Release notes](https://github.com/nextcloud/coding-standard/releases) - [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format code to a single space around binary operatorsChristoph Wurst2020-10-051-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to ↵Morris Jobke2020-08-121-34/+34
| | | | | | \PHPUnit\Framework\MockObject\MockObject Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* dont get the group details if we only ask for the idRobin Appelman2020-05-071-11/+9
| | | | | | | currenty when getting the groups for a user, the full group object is always created (and cached) even if only the groupid is required Signed-off-by: Robin Appelman <robin@icewind.nl>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-15/+14
| | | | | | | | | | | | | | | 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>
* Remove space between switch case and colonChristoph Wurst2020-04-091-32/+32
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-091-13/+13
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix (array) indent style to always use one tabChristoph Wurst2020-04-091-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix multiline commentsChristoph Wurst2020-04-081-19/+19
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #20170 from nextcloud/techdebt/remove-unused-importsChristoph Wurst2020-03-271-2/+0
|\ | | | | Remove unused imports
| * Remove unused importsChristoph Wurst2020-03-251-2/+0
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Use the short array syntax, everywhereChristoph Wurst2020-03-264-55/+55
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-253-121/+121
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Mode to modern phpunitRoeland Jago Douma2019-11-273-3/+3
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-275-6/+6
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #17896 from nextcloud/fix/noid/consider-create-group-resultblizzz2019-11-251-0/+30
|\ | | | | take group creation result into consideration
| * take group creation result into considerationArthur Schiwon2019-11-251-0/+30
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | Some php-cs fixesRoeland Jago Douma2019-11-221-1/+2
|/ | | | | | | | | | | * 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>
* Add dispatcher events to User and Group objectsJoas Schilling2019-03-012-53/+68
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Tests fixJohn Molakvoæ (skjnldsv)2018-06-151-5/+5
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fixed caldav tests and metadata 2John Molakvoæ (skjnldsv)2018-03-081-3/+3
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fix Metadata testsJohn Molakvoæ (skjnldsv)2018-03-081-1/+8
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fix risky tests without assertionsJoas Schilling2018-01-251-0/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Use ::class in test mocksMorris Jobke2017-10-241-2/+4
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Remove legacy OC_User_Backend and OC_User_InterfaceRoeland Jago Douma2017-07-241-2/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix 5.6 duplicate class importJoas Schilling2017-03-171-3/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Clean up the testJoas Schilling2017-03-171-81/+52
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Use DIJoas Schilling2017-03-171-27/+31
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Skip null groups in group manager (#26871) (#26956)Vincent Petry2017-03-171-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Skip null groups in group manager (#26871) * Skip null groups in group manager * Also skip null groups in group manager's search function * Add more group null checks in sharing code * Add unit tests for null group safety in group manager * Add unit tests for sharing code null group checks * Added tests for null groups handling in sharing code * Ignore moveShare optional repair in mount provider In some cases, data is inconsistent in the oc_share table due to legacy data. The mount provider might attempt to make it consistent but if the target group does not exist any more it cannot work. In such case we simply ignore the exception as it is not critical. Keeping the exception would break user accounts as they would be unable to use their filesystem. * Adjust null group handing + tests * Fix new group manager tests Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Remove legacy class OC_Group and OC_UserMorris Jobke2017-03-091-208/+0
| | | | | | * basically a straight replacement of the wrapped code at the calling code parts Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* fix more testsArthur Schiwon2016-12-221-23/+23
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>