Skip to content

Add unit tests for AdminDelegation command and AuthorizedGroupService - #55676

Merged
sorbaugh merged 2 commits into
nextcloud:masterfrom
IONOS-Productivity:feature/add_tests_to_settings_delegation
Oct 21, 2025
Merged

Add unit tests for AdminDelegation command and AuthorizedGroupService#55676
sorbaugh merged 2 commits into
nextcloud:masterfrom
IONOS-Productivity:feature/add_tests_to_settings_delegation

Conversation

@printminion-co

@printminion-coprintminion-co commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

Summary

  • php unitests are testing occ admin-delegation:add in order to extend admin-delegation functionality later
occ admin-delegation:add OCA\\DAV\\Settings\\CalDAVSettings group1 

Checklist

@printminion-co
printminion-coforce-pushed the feature/add_tests_to_settings_delegation branch from 9fe7144 to 13a5410CompareOctober 10, 2025 15:26

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive unit tests for the AdminDelegation Add command and AuthorizedGroupService to support future functionality extensions. The tests validate the core delegation functionality including permission creation, input validation, and error handling scenarios.

Key changes:

  • Added unit tests for AuthorizedGroupService covering group-class relationship validation
  • Added unit tests for AdminDelegation Add command covering success and error scenarios
  • Implemented reflection-based testing approach for protected command execution methods

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

FileDescription
apps/settings/tests/Service/AuthorizedGroupServiceTest.phpTests for AuthorizedGroupService validating creation of authorized groups with different group/class combinations
apps/settings/tests/Command/AdminDelegation/AddTest.phpTests for AdminDelegation Add command covering successful delegation, invalid setting classes, and non-existent groups

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@printminion-co
printminion-co marked this pull request as ready for review October 10, 2025 15:45
@printminion-co
printminion-co requested a review from a team as a code ownerOctober 10, 2025 15:45
@printminion-co
printminion-co requested review from Altahrim, CarlSchwan and salmart-dev and removed request for a teamOctober 10, 2025 15:45
Comment threadapps/settings/tests/Command/AdminDelegation/AddTest.php Outdated
Comment threadapps/settings/tests/Command/AdminDelegation/AddTest.php Outdated
Comment threadapps/settings/tests/Command/AdminDelegation/AddTest.php Outdated
Comment threadapps/settings/tests/Command/AdminDelegation/AddTest.php
Comment threadapps/settings/tests/Command/AdminDelegation/AddTest.php Outdated
@printminion-co
printminion-coforce-pushed the feature/add_tests_to_settings_delegation branch from e562481 to 43476fbCompareOctober 13, 2025 08:55
@sorbaugh
sorbaugh requested a review from come-ncOctober 14, 2025 08:40

@provokateurinprovokateurin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just two minor things that you might want to change.

Comment threadapps/settings/tests/Command/AdminDelegation/AddTest.php Outdated
Comment threadapps/settings/tests/Service/AuthorizedGroupServiceTest.php
@printminion-co
printminion-coforce-pushed the feature/add_tests_to_settings_delegation branch 4 times, most recently from b742eff to 0721e52CompareOctober 17, 2025 08:22
…edGroupService
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
to simplify test execution
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
@printminion-co
printminion-coforce-pushed the feature/add_tests_to_settings_delegation branch from 0721e52 to 4275825CompareOctober 20, 2025 10:55
@printminion-co

printminion-co commented Oct 20, 2025

Copy link
Copy Markdown
ContributorAuthor

I assume with 3 review ok - it can be merged to master @come-nc

@sorbaugh
sorbaugh merged commit d49dc7e into nextcloud:masterOct 21, 2025
174 of 177 checks passed
@printminion-co

Copy link
Copy Markdown
ContributorAuthor

/backport to stable31

@backportbot

Copy link
Copy Markdown

The backport to stable31 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable31
git pull origin stable31
# Create the new backport branch
git checkout -b backport/55676/stable31
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts, resolve them
git cherry-pick b0413be6 42758251
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/55676/stable31

Error: Failed to push branch backport/55676/stable31: remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/nextcloud/server.git/'


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@printminion-co
printminion-co deleted the feature/add_tests_to_settings_delegation branch October 28, 2025 09:28
@artongeartonge added this to the Nextcloud 33 milestone Oct 28, 2025
@artonge

Copy link
Copy Markdown
Collaborator

/backport to stable32

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@printminion-co@artonge@provokateurin@come-nc@sorbaugh