From b3d40aae336021b2a6bac5ab1105efaa79cceedb Mon Sep 17 00:00:00 2001 From: Mason James Date: Sun, 29 Jan 2017 00:47:20 +1300 Subject: [PATCH] Bug 18009 - IssueSlip.t test fails if launched between 00:00 and 00:59 to test patch... 1/ set date between 00:00 and 00:59 $ sudo date -s 'Sun Jan 29 00:41:55 NZDT 2017' 2/ run prove, see fail $ prove -v t/db_dependent/Members/IssueSlip.t ... t/db_dependent/Members/IssueSlip.t (Wstat: 65280 Tests: 1 Failed: 0) Result: FAIL 3/ apply patch 4/ run prove, see pass $ prove -v t/db_dependent/Members/IssueSlip.t ... All tests successful. Result: PASS --- t/db_dependent/Members/IssueSlip.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Members/IssueSlip.t b/t/db_dependent/Members/IssueSlip.t index 7cec9db767..660047e50d 100644 --- a/t/db_dependent/Members/IssueSlip.t +++ b/t/db_dependent/Members/IssueSlip.t @@ -251,7 +251,7 @@ EOS $date_due_in_time_as_formatted = output_pref( $date_due_in_time ); $issue_date = $date_due_in_time->clone->subtract_duration( DateTime::Duration->new( minutes => 1 ) ); AddIssue( $borrower, $barcode1, $date_due_in_time, undef, $issue_date ); - $date_due_in_late = $today->clone->set(hour => $today->hour - 1); + $date_due_in_late = $today->clone->subtract( hours => 1 ); $date_due_in_late_as_formatted = output_pref( $date_due_in_late ); $issue_date = $yesterday->clone; AddIssue( $borrower, $barcode2, $date_due_in_late, undef, $issue_date ); @@ -375,7 +375,7 @@ EOS $date_due_in_time_as_formatted = output_pref( $date_due_in_time ); $issue_date = $date_due_in_time->clone->subtract_duration( DateTime::Duration->new( minutes => 1 ) ); AddIssue( $borrower, $barcode1, $date_due_in_time, undef, $issue_date ); - $date_due_in_late = $today->clone->set(hour => $today->hour - 1); + $date_due_in_late = $today->clone->subtract( hours => 1 ); $date_due_in_late_as_formatted = output_pref( $date_due_in_late ); $issue_date = $yesterday->clone; AddIssue( $borrower, $barcode2, $date_due_in_late, undef, $issue_date ); -- 2.39.5