Koha-clms/t/db_dependent/Circulation
Jonathan Druart 4e6d9defc1 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>
2018-10-17 12:28:13 +00:00
..
IssuingRules Bug 21133: Fix use statements order 2018-07-31 16:28:02 -03:00
Branch.t Bug 21133: Fix use statements order 2018-07-31 16:28:02 -03: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-09-26 16:00:12 +00:00
Chargelostitem.t Bug 21133: Fix use statements order 2018-07-31 16:28:02 -03:00
CheckIfIssuedToPatron.t Bug 21133: Fix use statements order 2018-07-31 16:28:02 -03:00
CheckValidBarcode.t Bug 18292: Remove return 1 statements in tests 2017-08-15 12:17:42 -03:00
GetHardDueDate.t Bug 19804: Fix test in GetHardDueDate.t 2018-04-09 17:44:19 -03:00
GetPendingOnSiteCheckouts.t Bug 21133: Fix use statements order 2018-07-31 16:28:02 -03:00
GetTopIssues.t Bug 20287: Replace occurrences of AddMember with Koha::Patron->new->store->borrowernumber 2018-07-18 15:49:47 +00:00
IsItemIssued.t Bug 21133: Fix use statements order 2018-07-31 16:28:02 -03:00
MarkIssueReturned.t Bug 20287: Replace occurrences of AddMember with Koha::Patron->new->store->borrowernumber 2018-07-18 15:49:47 +00:00
NoIssuesChargeGuarantees.t Bug 19943: Fix NoIssuesChargeGuarantees.t - create the biblioitem entry 2018-03-23 13:24:15 -03:00
OfflineOperation.t Bug 20144: [sql_modes] Set value for pending_offline_operations.timestamp 2018-02-13 13:58:59 -03:00
Returns.t Bug 21231: Add Unit Test 2018-08-30 13:40:30 +00: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-10-17 12:28:13 +00:00
TooMany.t Bug 21133: Fix use statements order 2018-07-31 16:28:02 -03:00
dateexpiry.t Bug 19943: Fix dateexpiry.t - create the biblioitem entry 2018-03-23 13:24:15 -03:00
issue.t Bug 21133: Fix use statements order 2018-07-31 16:28:02 -03:00
transfers.t Bug 21133: Fix use statements order 2018-07-31 16:28:02 -03:00