Koha-clms/t
Pedro Amorim d6ce5833b7
Bug 41237: Add tests
Test plan, k-t-d:
1) Apply tests patch, run:
prove t/db_dependent/Koha/ILL/Requests.t
2) Notice it fails. Apply the second patch. Repeat. Notice it passes.

Test failure explanation (before fix patch):
    #   Failed test 'Cardnumber not supplied and couldnt find additional_contents for all libraries. Dont show copyrightclearance'
    #   at t/db_dependent/Koha/ILL/Requests.t line 1067.
    #          got: 'copyrightclearance'
    #     expected: 'commit'

Its searching the copyrightclearance additional_contents for the provided branchcode param (illrq->patron->branchcode) (and finding one) when it shouldn't. That parameter is only to be utilized for the newly created ILL request's library. The branchcode filter of the additional_contents must the be logged in user's cardnumber, not params->{branchcode}. If no logged in user exists and this stage is reached (ILLOpacUnauthenticatedRequest), then only 'All libraries' ILLModuleCopyrightClearance are to be fetched, as expected.

Human test plan, before applying patches:
1) Enable ILLModule
2) Logged in as koha:koha, create an OPAC request, visit:
<opac_url>/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
3) Pick any library not Centerville (the default library of the 'koha' user)
4) Notice the created request's library is CPL (Centerville). It ignored the library selection from the form.
5) Apply patches. Repeat. Notice the request's library is now the one that was selected on the form.

Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
2026-02-27 11:55:14 -05:00
..
Acquisition
…
Biblio Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Budgets
…
Circulation Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
External
…
Koha Bug 41076: [25.05.x] Adjust perl tidiness 2026-02-24 08:35:34 -07:00
Number
…
SIP Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Search Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Serials Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Template Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Test Bug 41076: [25.05.x] Adjust perl tidiness 2026-02-24 08:35:34 -07:00
cypress Bug 41001: (QA follow-up): Add 'Confirmation messages with inputs' specific tests 2026-02-17 16:53:26 +00:00
data Bug 41032: Fix Open Fifth missing in plugin repos config 2025-12-01 15:53:27 +01:00
db_dependent Bug 41237: Add tests 2026-02-27 11:55:14 -05:00
edi_testfiles
…
etc
…
lib Bug 41076: [25.05.x] Adjust perl tidiness 2026-02-24 08:35:34 -07:00
mock_templates/intranet-tmpl/prog Bug 41177: Add aria-disabled to breadcrumbs 2025-12-01 15:53:08 +01:00
00-check-atomic-updates.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
00-load.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
00-merge-conflict-markers.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
00-testcritic.t
…
00-valid-xml.t Bug 41076: [25.05.x] Adjust perl tidiness 2026-02-24 08:35:34 -07:00
Auth.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
AuthoritiesMarc_MARC21.t
…
AuthoritiesMarc_UNIMARC.t
…
Barcodes_EAN13.t
…
Barcodes_annual.t
…
Barcodes_hbyymmincr.t
…
Barcodes_incremental.t
…
Biblio.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Biblio2.t
…
Budgets.t
…
Charset.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Circulation_barcodedecode.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
ClassSortRoutine.t
…
ClassSortRoutine_Dewey.t
…
ClassSortRoutine_Generic.t
…
ClassSortRoutine_LCC.t
…
ClassSource.t
…
Context.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Contract.t
…
CookieManager.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Creators.t
…
DateUtils.t
…
EdiInvoice.t
…
Edifact.t Bug 40386: Remove warnings from EDI when running tests 2025-08-22 09:47:50 +02:00
Ediorder.t
…
Ediordrsp.t
…
Form_MessagingPreferences.t Bug 34776: Add unit tests for sub restore_form_values 2025-07-10 22:47:22 +02:00
HtmlTags.t
…
ImportBatch.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Installer_PerlModules.t
…
ItemCirculationAlertPreference.t
…
Koha_MetadataRecord.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Koha_SearchEngine_Elasticsearch_Browse.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Koha_Template_Plugin_HtmlId.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Koha_Template_Plugin_Koha.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Koha_Util_FrameworkPlugin.t
…
Koha_Util_MARC.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Koha_XSLT_HTTPS.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Labels.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Labels_split_Regex.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Labels_split_ccn.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Labels_split_ddcn.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Labels_split_lccn.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Languages.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Logger.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Makefile.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Members_Messaging.t
…
OpenLibrarySearch.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Output.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Output_JSONStream.t
…
Patroncards.t
…
Patroncards_Batch.t
…
Patroncards_Lib.t
…
Patroncards_Patroncard.t
…
Patroncards_Profile.t
…
Patroncards_Template.t
…
RecordProcessor.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Ris.t
…
SMS.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Scheduler.t
…
Scrubber.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Search.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
Search_PazPar2.t
…
SimpleMARC.t
…
SuggestionEngine.t
…
SuggestionEngine_AuthorityFile.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
TmplToken.t
…
Token.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
template_filters.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
timezones.t
…