Koha/t
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
Biblio
Budgets
Circulation
cypress Bug 32474: (follow-up): Tell the tests to wait for the intercepted request responses 2024-02-02 13:37:03 +01:00
data Bug 31393: Koha::Config: handle the special case for 'content' attribute 2023-10-30 09:02:17 -03:00
db_dependent Bug 35904: Make C4::Auth::checkauth testable easily 2024-03-01 10:55:21 +01:00
edi_testfiles
etc
External
Koha Bug 30230: (follow-up) fix unit test 2024-01-29 12:25:09 +01:00
lib Bug 34913: Fix a selenium test 2024-01-26 15:13:41 +01:00
Number
Search Bug 34969: Remove unneeded module from buildQuery.t 2023-10-04 09:15:42 -04:00
Serials
SIP
Template Bug 33030: Add unit tests 2023-07-14 16:52:06 -03:00
Test
00-check-atomic-updates.t Bug 31479: Option to skip t/00-check-atomic-updates.t when building custom packages 2023-05-10 15:26:20 -03:00
00-deprecated.t
00-load.t
00-merge-conflict-markers.t
00-testcritic.t Bug 34911: Test files from HEAD instead of 'master' 2023-10-04 09:15:35 -04:00
00-valid-xml.t
Auth.t
AuthoritiesMarc_MARC21.t
AuthoritiesMarc_UNIMARC.t
Barcodes_annual.t
Barcodes_EAN13.t
Barcodes_hbyymmincr.t
Barcodes_incremental.t
Biblio.t
Biblio2.t
Budgets.t
Charset.t
Circulation_barcodedecode.t
ClassSortRoutine.t
ClassSortRoutine_Dewey.t
ClassSortRoutine_Generic.t
ClassSortRoutine_LCC.t
ClassSource.t
Context.t Bug 29033: Add C4::Context->multivalue_preference 2023-10-10 10:53:59 -03:00
Contract.t
CookieManager.t
Creators.t
DateUtils.t
dummy.t
Edifact.t
EdiInvoice.t
Ediorder.t
Ediordrsp.t
Form_MessagingPreferences.t
HtmlTags.t
ImportBatch.t
Installer_PerlModules.t
ItemCirculationAlertPreference.t
Koha_MetadataRecord.t Bug 33749: Use TrimFields instead of stripWhitespaceChars 2023-11-03 12:08:06 -03:00
Koha_SearchEngine_Elasticsearch_Browse.t
Koha_Template_Plugin_Cache.t
Koha_Template_Plugin_HtmlId.t
Koha_Template_Plugin_Koha.t
Koha_Util_FrameworkPlugin.t
Koha_Util_MARC.t
Koha_XSLT_HTTPS.t
Labels.t
Labels_split_ccn.t Bug 30110: Fix concatenation during assignements 2022-03-24 14:22:10 -10:00
Labels_split_ddcn.t
Labels_split_lccn.t
Labels_split_Regex.t
Languages.t
Logger.t Bug 32979: Skip test if running as root 2023-02-20 09:44:16 -03:00
Makefile.t
Members_Messaging.t
OpenLibrarySearch.t
Output.t Bug 30524: Unit tests 2023-08-07 20:59:59 -03:00
Output_JSONStream.t
Patroncards.t
Patroncards_Batch.t
Patroncards_Lib.t
Patroncards_Patroncard.t
Patroncards_Profile.t
Patroncards_Template.t
RecordProcessor.t Bug 33749: (QA follow-up) Tidy code for qa script 2023-11-03 12:08:07 -03:00
Ris.t
Scheduler.t
Scrubber.t
Search.t Bug 34968: Remove unneeded module from Search.t 2023-10-04 09:32:46 -04:00
Search_PazPar2.t
SimpleMARC.t Bug 24480: (follow-up) Adjust tests 2023-11-03 12:04:35 -03:00
SMS.t
SuggestionEngine.t
SuggestionEngine_AuthorityFile.t Bug 34970: Remove most modules from SuggestionEngine_AuthorityFile.t 2023-10-04 09:15:41 -04:00
template_filters.t
timezones.t
TmplToken.t
Token.t Bug 34163: Handle both anonymous userenv when generating CSRF tokens 2023-09-12 09:45:01 -03:00