Skip to content

Conversation

@nabim777
Copy link
Collaborator

@nabim777 nabim777 commented Aug 7, 2025

Description

This PR updates in unit test to use a mock GuestAvatar. The getFile() method is mocked to return a fake file with a test image from fixtures/openproject-icon.jpg.

This mock is needed because:

  • In Nextcloud PR #51855, the GuestAvatar constructor was changed to accept 3 arguments.
  • But older branches still use the 2-argument version, so mocking helps avoid compatibility issues.

Related Issue or Workpackage

  • Fixes <issue_link>

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Updated CHANGELOG.md file

@nabim777 nabim777 changed the title tests: fix GuestAvatar mock in OpenProjectAPIServiceTest Fix GuestAvatar mock in OpenProjectAPIServiceTest Aug 7, 2025
@nabim777 nabim777 force-pushed the fix/guestavatar-mock branch from 8fbebea to c1e6b61 Compare August 7, 2025 06:56
@nabim777 nabim777 self-assigned this Aug 7, 2025
@nabim777 nabim777 changed the title Fix GuestAvatar mock in OpenProjectAPIServiceTest Fix GuestAvatar mock in tests Aug 7, 2025
@nabim777 nabim777 force-pushed the fix/guestavatar-mock branch 4 times, most recently from 563ae4f to 646df1a Compare August 8, 2025 09:49
@nabim777 nabim777 changed the title Fix GuestAvatar mock in tests Mock GuestAvatar in php unit tests Aug 8, 2025
@nabim777 nabim777 force-pushed the fix/guestavatar-mock branch from 646df1a to 50825df Compare August 8, 2025 10:04
@nabim777 nabim777 marked this pull request as ready for review August 8, 2025 11:02
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
@nabim777 nabim777 force-pushed the fix/guestavatar-mock branch from 50825df to e5ace0c Compare August 8, 2025 11:08
@nabim777 nabim777 requested a review from saw-jan August 8, 2025 11:09
@nabim777 nabim777 merged commit 265b3f4 into master Aug 8, 2025
11 checks passed
@nabim777 nabim777 deleted the fix/guestavatar-mock branch August 8, 2025 11:26
@github-actions
Copy link

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.)

Sign up for free to 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.

3 participants