Koha-clms/t/db_dependent/Circulation
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
..
Branch.t Bug 25426: (QA follow-up) Make subtest stand on its own 2022-10-18 09:35:17 -03:00
CalcDateDue.t Bug 6796: (follow-up) QA test tool fixes 2024-04-12 11:26:06 +02:00
CalcFine.t Bug 34279: Don't enforce overduefinescap unless it is greater than 0 2023-07-19 13:00:41 -03:00
CheckIfIssuedToPatron.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
CheckValidBarcode.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
GetHardDueDate.t Bug 29144: Remove opac_info from a few tests 2022-09-16 09:55:20 -03:00
GetPendingOnSiteCheckouts.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
GetTopIssues.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
IsItemIssued.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
MarkIssueReturned.t Bug 29145: (QA follow-up) Fix tests removing 'unblessed' 2023-10-03 09:24:44 -04:00
NoIssuesChargeGuarantees.t Bug 28924: Add unit tests for new methods and update existing tests 2024-07-18 18:25:54 +02:00
OfflineCirculation.t Bug 34529: (QA follow-up) Tidy OfflineCirculation.t 2023-11-06 11:34:46 -03:00
OfflineOperation.t Bug 29144: Remove opac_info from a few tests 2022-09-16 09:55:20 -03:00
ReturnClaims.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
Returns.t Bug 35587: (QA follow-up): QA script tidy 2024-01-05 14:04:05 +01:00
StoreLastBorrower.t Bug 32894: (follow-up) Koha::Item->last_returned_by 2023-06-07 16:44:04 -03:00
SwitchOnSiteCheckouts.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
TooMany.t Bug 30324: (follow-up) Remove stray comments 2024-04-29 09:35:32 +02:00
_CalculateAndUpdateFine.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
dateexpiry.t Bug 36567: Get rid of Datetime warning in Circulation.t and dateexpiry.t 2024-05-03 16:02:45 +02:00
issue.t Bug 36687: (RM follow-up) Fix unit tests 2024-05-09 09:22:00 +01:00
maxsuspensiondays.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
transferbook.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
transfers.t Bug 24295: Finally remove GetTransfers from C4/Circulation 2022-08-26 15:42:56 -03:00