Koha-clms/t/db_dependent/Circulation
Jonathan Druart ae754c73e0 Bug 21155: Prevent SwitchOnSiteCheckouts.t to fail randomly
#   Failed test 'The date_due should have been set depending on the circ
 rules when the on-site checkout has been switched'
 #   at t/db_dependent/Circulation/SwitchOnSiteCheckouts.t line 126.
 #          got: '2018-10-16T23:59:00'
 #     expected: '2018-10-21T23:59:00'

TestBuilder set date to today, so issuingrules.harduedate will be set to
today.
issuingrules.hardduedatecompare will be set to an integer.
If set to 0, $datedue will be reset to the hard due date

The call stack is: AddIssue > CalcDateDue > GetHardDueDate

In GetHardDueDate:
3509         if ( $hardduedatecompare == 0 || $hardduedatecompare == $cmp ) {
3510             $datedue = $hardduedate->clone;
3511         }

To fix this random failure we need to set issuingrules.harduedate to undef.

Test plan:
0. Do not apply this patch
1. Modify the test to set hardduedatecompare to 0 (search 'my $issuingrule = ')
2. Execute the test and confirm the failure
3. Apply this patch
4. Execute the test and confirm the it is no longer failing

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4e6d9defc1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c82207ebb5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-11-09 12:57:51 +01:00
..
IssuingRules Bug 21133: [18.05.x] Fix use statements order 2018-10-10 12:39:18 +02:00
Branch.t Bug 21133: [18.05.x] Fix use statements order 2018-10-10 12:39:18 +02:00
CalcDateDue.t Bug 11580: Add one more test and clear the cache 2017-09-06 12:52:48 -03:00
CalcFine.t Bug 21196: Add tests 2018-10-03 15:09:43 +02:00
Chargelostitem.t Bug 21133: [18.05.x] Fix use statements order 2018-10-10 12:39:18 +02:00
CheckIfIssuedToPatron.t Bug 21133: [18.05.x] Fix use statements order 2018-10-10 12:39:18 +02:00
CheckValidBarcode.t Bug 18292: Remove return 1 statements in tests 2017-08-15 12:17:42 -03:00
GetHardDueDate.t Bug 16344: Fix test in GetHardDueDate.t 2017-05-24 12:29:43 -03:00
GetPendingOnSiteCheckouts.t Bug 21133: [18.05.x] Fix use statements order 2018-10-10 12:39:18 +02:00
GetTopIssues.t Bug 17829: Move GetMember to Koha::Patron 2017-07-10 13:14:19 -03:00
IsItemIssued.t Bug 21133: [18.05.x] Fix use statements order 2018-10-10 12:39:18 +02:00
MarkIssueReturned.t Bug 19513: Re-add AnonymousPatron-related tests 2017-10-25 12:14:40 -03:00
NoIssuesChargeGuarantees.t Bug 20250: (bug 19529 follow-up) Prevent NoIssuesChargeGuarantees.t to fail randomly 2018-03-23 10:24:24 +00:00
OfflineOperation.t Bug 12787: Reorganise t/db_dependent files 2016-04-22 00:54:35 +00:00
Returns.t Bug 21133: [18.05.x] Fix use statements order 2018-10-10 12:39:18 +02:00
StoreLastBorrower.t Bug 18292: Remove return 1 statements in tests 2017-08-15 12:17:42 -03:00
SwitchOnSiteCheckouts.t Bug 21155: Prevent SwitchOnSiteCheckouts.t to fail randomly 2018-11-09 12:57:51 +01:00
TooMany.t Bug 21133: [18.05.x] Fix use statements order 2018-10-10 12:39:18 +02:00
dateexpiry.t Bug 20145: Do not insert 0000-00-00 in patron tests (and more) 2018-03-23 10:16:24 +00:00
issue.t Bug 21133: [18.05.x] Fix use statements order 2018-10-10 12:39:18 +02:00
transfers.t Bug 21133: [18.05.x] Fix use statements order 2018-10-10 12:39:18 +02:00