summaryrefslogtreecommitdiffstats
path: root/tests/lib/Group/ManagerTest.php
Commit message (Collapse)AuthorAgeFilesLines
* Fix tests, and fix Group::searchUsers to avoid duplicatesCôme Chilliet2023-05-021-1/+5
| | | | | | | | 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-271-43/+12
| | | | | | | | | 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-201-17/+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>
* 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>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-17/+17
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-251-83/+83
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Mode to modern phpunitRoeland Jago Douma2019-11-271-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-271-1/+1
| | | | 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-011-29/+34
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* 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>
* fix more testsArthur Schiwon2016-12-221-23/+23
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Adding group display name supportVincent Petry2016-12-221-214/+223
|
* Improve ManagerTestRoeland Jago Douma2016-07-111-205/+203
| | | | | * No DB required * Fixed phpunit 5.4 warnings
* Move tests/ to PSR-4 (#24731)Joas Schilling2016-05-201-0/+897
* Move a-b to PSR-4 * Move c-d to PSR-4 * Move e+g to PSR-4 * Move h-l to PSR-4 * Move m-r to PSR-4 * Move s-u to PSR-4 * Move files/ to PSR-4 * Move remaining tests to PSR-4 * Remove Test\ from old autoloader