Skip to content

Missing user mock in EditorialReminderTest cause test break in OPS #11298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
touhidurabir opened this issue Apr 21, 2025 · 3 comments
Closed
1 task done
Assignees
Milestone

Comments

@touhidurabir
Copy link
Member

touhidurabir commented Apr 21, 2025

Valid Title

  • I have updated the title to accurately reflect the bug description

Description

In the EditorialReminderTest, there is a missing user mock to inject in the UserRepository mock which cause the tests to break for OPS only after the merge of #10214 .

Steps to Reproduce

Run the unit tests for OPS only .

Expected Result

All tests should be passed .

Actual Result

Test error as

TypeError: PKP\security\RoleDAO::getByUserId(): Argument #1 ($userId) must be of type int, null given, called in /Users/abir/Sites/code/ops-stable-3_5_0/lib/pkp/classes/user/User.php on line 443
   │
   │ /Users/abir/Sites/code/ops-stable-3_5_0/lib/pkp/classes/security/RoleDAO.php:61
   │ /Users/abir/Sites/code/ops-stable-3_5_0/lib/pkp/classes/user/User.php:443
   │ /Users/abir/Sites/code/ops-stable-3_5_0/lib/pkp/classes/user/User.php:411
   │ /Users/abir/Sites/code/ops-stable-3_5_0/lib/pkp/jobs/email/EditorialReminder.php:65
   │ /Users/abir/Sites/code/ops-stable-3_5_0/lib/pkp/tests/jobs/email/EditorialReminderTest.php:211

Environment Details

No response

Application Version

OPS 3.4.0, 3.5.0 and main

Logs

No response

Additional Information

No response

PRs

main

pkp-lib --> #11302
ojs --> pkp/ojs#4847 [TEST ONLY]
ops --> pkp/ops#965 [TEST ONLY]

stable-3.5.0

pkp-lib --> #11299
ojs --> pkp/ojs#4844 [TEST ONLY]
ops --> pkp/ops#963 [TEST ONLY]

Stable-3.4.0

pkp-lib --> #11301
ojs --> pkp/ojs#4845 [TEST ONLY]
ops --> pkp/ops#964 [TEST ONLY]

@touhidurabir touhidurabir self-assigned this Apr 21, 2025
@touhidurabir touhidurabir added this to the 3.5.0 LTS milestone Apr 21, 2025
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Apr 21, 2025
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Apr 21, 2025
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Apr 21, 2025
touhidurabir added a commit to touhidurabir/ops that referenced this issue Apr 21, 2025
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Apr 21, 2025
touhidurabir added a commit to touhidurabir/ops that referenced this issue Apr 21, 2025
@touhidurabir
Copy link
Member Author

touhidurabir commented Apr 21, 2025

Hi @asmecher @bozana @Vitaliy-1 can one of you merge the PRs at #11298 (comment) , only for the pkp-lib . This fix a test regression of which cause the unit tests in OPS to fail .

@asmecher
Copy link
Member

@touhidurabir, I've merged the 3 pkp-lib PRs.

@touhidurabir
Copy link
Member Author

@asmecher thanks . closing this as completed .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants