Koha-clms/t/db_dependent
Matt Blenkinsop c76dc7fb08
Bug 28924: Add unit tests for new methods and update existing tests
This commit adds unit tests for the two new methods introduced and also updates all unit tests that use the noissuecharge sysprefs

Test plan:
1. Choose a patron and note their patron category
2. Create a manual invoice on that patron for 6.00
3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit.
4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit
5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron
6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7
7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set.
8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1).
9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00
10. Choose a third patron with a category of child or similar (patron 3)
11. Make patron 1 a guarantor for patron 3
12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5.
13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account
14. Try to checkout to patron 1 - it should still be possible
15. Add a fine to patron 3’s account for 2.00
16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees

Test plan:
prove t/db_dependent/SIP/Transaction.t
prove t/db_dependent/SIP/Patron.t
prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t
prove t/db_dependent/Koha/Patron.t

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-07-18 18:25:54 +02:00
..
Acquisition Bug 32132: Fix failing tests 2024-04-23 16:47:05 +01:00
Auth Bug 36056: Clarify subpermissions AND behavior 2024-03-07 17:35:40 +01:00
AuthoritiesMarc
…
Authority Bug 36917: (follow-up) Add FIXME for marcflavour 2024-05-24 15:36:43 +02:00
Biblio Bug 35993: (follow-up) Another fix for MarcOverlayRules.t 2024-05-02 15:03:41 +02:00
Budgets Bug 27550: Add unit test for CloneBudgetHierarchy 2022-09-22 08:18:43 -03:00
Circulation Bug 28924: Add unit tests for new methods and update existing tests 2024-07-18 18:25:54 +02:00
CourseReserves Bug 32351: Fix CourseItems.t 2022-11-30 15:58:18 -03:00
Creators
…
Exporter Bug 25503: Add failing test for _get_biblio_for_export 2023-05-10 15:26:19 -03:00
Holds Bug 36923: Remove warnings from Holds/LocalHoldsPriority.t 2024-05-24 15:36:46 +02:00
HoldsQueue Bug 35826: Add unit tests. 2024-04-26 18:06:18 +02:00
Illrequest Bug 34838: (QA follow-up): TypeDisclaimer tests - Add 'type' to request metadata 2024-06-11 13:28:17 +01:00
Items Bug 36010: Fix Items/AutomaticItemModificationByAge.t failing since Bug 32029 2024-03-07 16:36:46 +01:00
Koha Bug 28924: Add unit tests for new methods and update existing tests 2024-07-18 18:25:54 +02:00
LDAP
…
Labels Bug 36687: (RM follow-up) Fix unit tests 2024-05-09 09:22:00 +01:00
Letters Bug 31383: Adjust and add tests 2023-10-20 14:43:57 -03:00
Members Bug 33947: Remove GetAllIssues 2023-10-20 11:03:03 -03:00
OAI Bug 29697: Replace some missing occurrences 2022-07-25 09:30:30 -03:00
Patron Bug 36367: Remove _new_userenv 2024-06-14 11:17:17 +01:00
Record Bug 33045: Fix shebang of marcrecord2csv.t 2023-09-15 11:57:17 -03:00
Reports
…
Reserves Bug 35959: Add missing use statements in tests 2024-07-08 17:49:19 +02:00
SIP Bug 28924: Add unit tests for new methods and update existing tests 2024-07-18 18:25:54 +02:00
Search
…
Serials Bug 23775: Claiming a serial issue doesn't create the next one 2023-07-03 10:35:09 -03:00
Template/Plugin Bug 29393: (QA follow-up) Tidy and make executable the new test 2024-04-29 17:38:01 +02:00
Utils Bug 34913: Adjust C4::Utils::DataTables::VirtualShelves 2024-01-26 15:13:42 +01:00
api/v1 Bug 36641: Fix tests 2024-07-18 18:25:50 +02:00
cronjobs
…
data Bug 35418: Add TR_B2 tests 2023-11-29 17:36:11 -03:00
misc/translator
…
selenium Bug 37283: Update expected error page title 2024-07-09 14:56:02 +02:00
www Bug 32693: Fix history.t 2024-05-08 18:23:57 +02:00
00-strict.t Bug 36999: Fix 00-strict.t fails to find koha_perl_deps.pl 2024-06-13 13:43:47 +01:00
Accounts.t Bug 34912: Add 14 hours to 1970 date in Account(s).t 2023-10-04 09:15:39 -04:00
Acquisition.t Bug 32132: (RM follow-up) Use testbuilder in Acquisitions.t 2024-04-24 10:08:28 +01:00
Amazon.t
…
ArticleRequests.t
…
AudioAlerts.t
…
Auth.t Bug 37104: Unit tests 2024-07-01 18:55:52 +02:00
AuthUtils.t
…
Auth_with_cas.t
…
Auth_with_ldap.t Bug 36575: Unit tests for checkpw_ldap 2024-06-20 17:55:30 +02:00
Auth_with_shibboleth.t Bug 36575: Unit tests for checkpw_shib 2024-06-20 17:55:31 +02:00
AuthorisedValues.t Bug 28869: Unit tests 2024-05-17 10:36:24 +02:00
AuthoritiesMarc.t Bug 35989: (QA follow-up): Fix QA tests 2024-06-06 15:18:43 +01:00
AuthoritiesMarc_GetTagsLabels.t
…
Barcodes.t
…
Barcodes_ValueBuilder.t
…
Biblio.t Bug 36938: Adjusts tests to remove warns 2024-06-10 16:20:16 +01:00
Biblio_holdsqueue.t
…
Breeding.t Bug 28166: (QA follow-up) Fix and tidy tests and code 2023-10-23 11:33:50 -03:00
Breeding_Auth.t Bug 33404: Add unit tests 2023-07-05 12:17:22 -03:00
Budgets.t Bug 31631: (QA follow-up) Tidy code 2023-10-18 15:41:37 -03:00
Cache.t
…
Calendar.t Bug 33727: (QA follow-up) perl tidy whole file 2023-07-14 12:14:37 -03:00
Charset.t
…
Circulation.t Bug 37016: Unit tests 2024-06-27 11:50:05 +02:00
Circulation_holdsqueue.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
Clubs.t
…
Context.t Bug 32687: Get server version in Context::get_versions 2023-02-24 17:52:28 -03:00
Contract.t
…
CourseReserves.t Bug 36687: (RM follow-up) Fix unit tests 2024-05-09 09:22:00 +01:00
DecreaseLoanHighHolds.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
Filter_MARC_ViewPolicy.t Bug 32648: Clear cache in Filter_MARC_ViewPolicy.t 2023-05-16 11:24:26 +02:00
Fines.t
…
FrameworkPlugin.t Bug 24879: (follow-up) Fix test suite 2024-04-03 17:05:52 +02:00
Heading.t Bug 33557: Add LinkerConsiderThesaurus system preference 2023-05-10 15:26:26 -03:00
Heading_MARC21.t Bug 33277: Do not search using thesaurus when linking non 6XX fields 2023-05-10 15:26:22 -03:00
Hold.t Bug 34032: (QA follow-up) Tidy code 2024-04-29 09:35:38 +02:00
Holds.t Bug 17617: Unit tests 2023-11-08 11:41:26 -03:00
HoldsQueue.t Bug 32565: (follow-up) Tidy 2024-04-30 14:32:07 +02:00
Holidays.t Bug 27249: Replace DateTime->now by dt_from_string 2023-10-17 14:45:34 -03:00
ILSDI_Services.t Bug 36453: Update tests 2024-06-11 10:43:53 +01:00
ImportBatch.t Bug 32804: (QA follow-up) Typo ahs and fix ImportBatch.t 2023-03-17 09:59:12 -03:00
ImportExportFramework.t
…
Installer.t
…
Items.t Bug 36535: (bug 33568 follow-up) Add missing tests 2024-04-26 14:14:48 +02:00
Koha.t Bug 34812: Move subtests to db_dependent/Koha.t 2023-09-18 12:06:27 -03:00
Koha_Database.t Bug 36367: Remove schema_stack 2024-06-14 11:17:18 +01:00
Koha_Elasticsearch.t Bug 35138: Fix Koha_Elasticsearch.t 2024-04-30 12:00:59 +02:00
Koha_ExternalContent_OverDrive.t
…
Koha_MetadataRecord_Authority.t Bug 30756: Rename to Koha_MetadataRecord_Authority 2022-06-02 13:53:39 -03:00
Koha_Misc_Files.t
…
Languages.t Bug 32775: (QA follow-up) remove useless empty line 2023-05-15 18:23:54 -03:00
Letters.t Bug 36520: Add tests 2024-06-20 17:55:35 +02:00
LibraryGroups.t
…
Linker_Default.t Bug 35125: Respect LinkerConsiderThesaurus in update_cache 2024-07-01 18:55:42 +02:00
Linker_FirstMatch.t
…
Log.t Bug 25159: (QA follow-up) Tidy changes 2024-05-02 16:47:44 +02:00
MarcModificationTemplates.t Bug 24480: (follow-up) Adjust tests 2023-11-03 12:04:35 -03:00
Matcher.t Bug 33869: Move Matcher.t to t/db_dependent 2023-09-01 11:07:45 -03:00
Members.t Bug 26170: Add protected status for patrons 2023-11-01 17:23:06 -03:00
Message.t Bug 33192: (QA follow-up) Fix it-IT sample data and unit tests 2023-04-14 11:35:40 -03:00
MungeMarcPrice.t
…
Overdues.t Bug 36128: (QA follow-up) Add regression test 2024-06-27 14:04:47 +02:00
Passwordrecovery.t Bug 31739: Password recovery from staff fails if previous expired reset-entry exists. 2022-10-24 14:12:16 -03:00
PatronLists.t Bug 32730: Add Patron Lists tab to patron details and circulation pages 2023-11-01 17:23:09 -03:00
Patroncards.t
…
Patrons.t Bug 36508: Unit tests 2024-04-30 14:32:04 +02:00
Prices.t Bug 34967: Move to db_dependent 2023-10-03 09:24:50 -04:00
Record.t
…
RecordProcessor_EmbedSeeFromHeadings.t
…
Reports.t
…
Reserves.t Bug 36687: (RM follow-up) Fix unit tests 2024-05-09 09:22:00 +01:00
RotatingCollections.t Bug 29144: Remove opac_info from a few tests 2022-09-16 09:55:20 -03:00
Search.t Bug 36924: Remove warning "Value not allowed for auto_incr itemnumber in Item" 2024-05-23 17:51:15 +02:00
Serials.t Bug 26567: Allow to limit subscription search to subscriptions with routing lists 2024-05-10 16:45:44 +02:00
Serials_2.t
…
Service.t
…
ShelfBrowser.t
…
Sitemapper.t Bug 33871: Test where parameter in Sitemapper.t 2023-09-01 11:23:26 -03:00
SocialData.t Bug 33833: Move to db_dependent 2023-09-05 14:35:36 -03:00
StockRotationItems.t
…
StockRotationRotas.t
…
StockRotationStages.t
…
SuggestionEngine_ExplodedTerms.t Bug 31069: Remove ExplodedTerms dependency on templates 2022-07-18 12:37:35 -03:00
Suggestions.t Bug 19097: Adjust some GetMarcFromKohaField calls 2024-04-29 09:35:47 +02:00
TablesSettings.t
…
Tags.t Bug 31517: Remove unused get_tag function 2022-11-04 19:30:56 -03:00
Templates.t
…
TestBuilder.t Bug 28966: (QA follow-up) Fix failing unit tests 2023-07-26 15:41:12 -03:00
Upload.t Bug 31598: Fix random failure on Jenkins for Upload.t 2022-09-22 08:07:01 -03:00
UsageStats.t
…
Virtualshelves.t Bug 30418: Unit tests 2023-05-15 18:23:58 -03:00
XISBN.t
…
XSLT.t Bug 33733: Move to db_dependent 2023-05-16 12:38:16 +02:00
check_kohastructure.t
…
check_sysprefs.t Bug 29948: Adjust sysprefs.sql 2024-05-13 16:24:17 +02:00
db_structure.t
…
rollingloans.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
sysprefs.t Bug 36793: Unit test 2024-05-17 10:36:34 +02:00
yaml.t
…
zebra_config.pl
…