Bug 40401 - Implement Koha::Patron->is_anonymous (was t/db_dependent/Auth.t generates warnings)
Summary: Implement Koha::Patron->is_anonymous (was t/db_dependent/Auth.t generates war...
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 40353
Blocks: 25515
  Show dependency treegraph
 
Reported: 2025-07-16 07:46 UTC by Jonathan Druart
Modified: 2025-07-16 08:07 UTC (History)
0 users

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40401: Implement Koha::Patron->is_anonymous (9.95 KB, patch)
2025-07-16 08:06 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2025-07-16 07:46:45 UTC
t/db_dependent/Auth.t .. 1/23 Use of uninitialized value $anonymous_patron in string eq at /kohadevbox/koha/C4/Auth.pm line 1497.
Use of uninitialized value $anonymous_patron in string eq at /kohadevbox/koha/C4/Auth.pm line 1497.       
Use of uninitialized value $anonymous_patron in string eq at /kohadevbox/koha/C4/Auth.pm line 1497.
Comment 1 Jonathan Druart 2025-07-16 08:06:59 UTC
Created attachment 184123 [details] [review]
Bug 40401: Implement Koha::Patron->is_anonymous

The first motivation of this patch is to remove the following warnings
from t/db_dependent/Auth.t:
Use of uninitialized value $anonymous_patron in string eq at /kohadevbox/koha/C4/Auth.pm line 1497

Actually a correct fix seems to add a new `is_anonymous` method to
Koha::Patron in order to remove the warnings from everywhere else.

Test plan:
Confirm that you cannot log in using the anonymous patron and that the 2
tests are passing
  prove t/db_dependent/Auth.t t/db_dependent/Koha/Patron.t