Skip to content

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

@touhidurabir

Description

@touhidurabir

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]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions