Koha/t/db_dependent
Jonathan Druart a82772d7ec
Bug 35904: Make C4::Auth::checkauth testable easily
This patch suggests to add a new flag do_not_print to
C4::Auth::checkauth to not print the headers and allow to test this
subroutine more easily.

We do no longer need to mock safe_exit and redirect STDOUT to test its
return values.

There are still 3 left:
1.
733         # checkauth will redirect and safe_exit if not authenticated and not authorized
=> Better to keep this one, not trivial to replace

2.
806         # This will fail on permissions
This should be replaced but testing $template->{VARS}->{nopermission}
fails, I dont' think the comment is better.

3.
828         # Patron does not have the borrowers permission
Same as 2.

2. and 3. should be investigated a bit more.

This patch also move duplicated code to set patron's password to a
subroutine set_weak_password.

Test plan:
Read the code and confirm that everything makes sense.
QA: Do you have a better way for this? Yes it's dirty!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2024-03-01 10:55:21 +01:00
..
Acquisition Bug 35524: Fix terminology in basket group CSV export 2023-12-18 15:21:00 +01:00
api/v1 Bug 30230: (QA follow-up) Add unit tests for API definition change 2024-01-29 12:25:10 +01:00
Auth
AuthoritiesMarc
Authority
Biblio
Budgets
Circulation Bug 35293: Unit test 2024-01-11 12:10:41 +01:00
CourseReserves
Creators
cronjobs
data Bug 35418: Add TR_B2 tests 2023-11-29 17:36:11 -03:00
Exporter
Holds Bug 8367: (QA follow-up) Fix QA script 2023-11-01 18:01:36 -03:00
Illrequest
Items Bug 32029: Automatic item modifications by age add biblio table 2024-01-26 15:13:50 +01:00
Koha Bug 35962: (bug 35843 follow-up 2) Fix BackgroundJob.t on D10 2024-02-06 08:52:36 +01:00
Labels Bug 10762: Fix tests continued 2023-10-28 10:02:31 -03:00
LDAP
Letters
Members
misc/translator
OAI
Patron
Record
Reports
Reserves Bug 17798: Confirm hold when printing slip from another patron's account 2023-11-06 08:42:41 -03:00
Search
selenium Bug 35598: Fix selenium/authentication_2fa.t random failure 2024-01-11 12:10:38 +01:00
Serials
SIP Bug 35461: Add unit tests 2024-01-26 15:13:56 +01:00
Template/Plugin
Utils Bug 34913: Adjust C4::Utils::DataTables::VirtualShelves 2024-01-26 15:13:42 +01:00
www Bug 35922: Fix www/batch.t 2024-01-29 14:08:40 +01:00
00-strict.t
Accounts.t
Acquisition.t
Amazon.t
ArticleRequests.t
AudioAlerts.t
Auth.t Bug 35904: Make C4::Auth::checkauth testable easily 2024-03-01 10:55:21 +01:00
Auth_with_cas.t
Auth_with_ldap.t Bug 29930: Regression tests 2024-01-26 15:13:48 +01:00
Auth_with_shibboleth.t
AuthorisedValues.t Bug 35588: Tidy up t/db_dependent/AuthorisedValues.t 2023-12-28 12:16:11 +01:00
AuthoritiesMarc.t Bug 27943: (QA follow-up) Perltidy 2023-10-30 09:02:21 -03:00
AuthoritiesMarc_GetTagsLabels.t
AuthUtils.t
Barcodes.t
Barcodes_ValueBuilder.t
Biblio.t
Biblio_holdsqueue.t
Breeding.t
Breeding_Auth.t
Budgets.t
Cache.t
Calendar.t
Charset.t
check_kohastructure.t
check_sysprefs.t Bug 34979: Add unit test for comparing YAMl files with sysprefs.sql 2024-01-26 15:13:53 +01:00
Circulation.t Bug 35322: (QA follow-up) Perltidy 2024-01-16 12:06:14 +01:00
Circulation_holdsqueue.t
Clubs.t
Context.t
Contract.t
CourseReserves.t
db_structure.t
DecreaseLoanHighHolds.t
Filter_MARC_ViewPolicy.t
Fines.t
FrameworkPlugin.t
Heading.t
Heading_MARC21.t
Hold.t
Holds.t Bug 17617: Unit tests 2023-11-08 11:41:26 -03:00
HoldsQueue.t
Holidays.t
Illbatches.t
IllbatchStatuses.t
Illcomments.t
Illrequestattributes.t
Illrequests.t
ILSDI_Services.t Bug 34893: (QA follow-up) Tidy code for qa script 2024-02-02 17:31:47 +01:00
ImportBatch.t
ImportExportFramework.t
Installer.t
Items.t
Koha.t
Koha_Database.t
Koha_Elasticsearch.t
Koha_ExternalContent_OverDrive.t
Koha_MetadataRecord_Authority.t
Koha_Misc_Files.t
Languages.t
Letters.t Bug 12133: (follow-up) Fix failing tests 2023-11-15 12:11:39 +01:00
LibraryGroups.t
Linker_Default.t
Linker_FirstMatch.t
Log.t
MarcModificationTemplates.t Bug 24480: (follow-up) Adjust tests 2023-11-03 12:04:35 -03:00
Matcher.t
Members.t Bug 26170: Add protected status for patrons 2023-11-01 17:23:06 -03:00
Message.t
MungeMarcPrice.t
Overdues.t
Passwordrecovery.t
Patroncards.t
PatronLists.t Bug 32730: Add Patron Lists tab to patron details and circulation pages 2023-11-01 17:23:09 -03:00
Patrons.t
Prices.t
Record.t
RecordProcessor_EmbedSeeFromHeadings.t
Reports.t
Reserves.t Bug 35491: Add logging to RevertWaitingStatus 2023-12-19 13:42:13 +01:00
rollingloans.t
RotatingCollections.t
Search.t
Serials.t
Serials_2.t
Service.t
ShelfBrowser.t
Sitemapper.t
SocialData.t
StockRotationItems.t
StockRotationRotas.t
StockRotationStages.t
SuggestionEngine_ExplodedTerms.t
Suggestions.t Bug 35215: Add few assumptions in Suggestions.t around emailing 2023-11-06 08:42:48 -03:00
sysprefs.t
TablesSettings.t
Tags.t
Templates.t
TestBuilder.t
Upload.t
UsageStats.t
Virtualshelves.t
XISBN.t
XSLT.t
yaml.t
zebra_config.pl