From 15f62f42d639e5408b0c81b7ff10db3bde730cac Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Sun, 16 Jul 2023 13:00:05 +0000 Subject: [PATCH] Bug 32496: (QA follow-up) Fix POD and DateTime use FAIL t/db_dependent/Koha/Object.t FAIL forbidden patterns forbidden pattern: Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840) (line 991) Signed-off-by: Katrin Fischer Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- C4/Circulation.pm | 2 +- t/db_dependent/Koha/Object.t | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 531b99f1f1..4c8b51e3c7 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2644,7 +2644,7 @@ sub MarkIssueReturned { C<$patron> patron object -C<$item> patron object +C<$item> item object C<$datedue> date due DateTime object diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t index b0ab60447b..c1b0b379d3 100755 --- a/t/db_dependent/Koha/Object.t +++ b/t/db_dependent/Koha/Object.t @@ -20,7 +20,6 @@ use Modern::Perl; use Test::More tests => 21; use Test::Exception; use Test::Warn; -use DateTime; use C4::Context; use C4::Circulation qw( AddIssue ); @@ -988,7 +987,7 @@ subtest 'unblessed_all_relateds' => sub { } ); - my $issue = AddIssue( $patron, $item->barcode, DateTime->now->subtract( days => 1 ) ); + my $issue = AddIssue( $patron, $item->barcode, dt_from_string()->subtract( days => 1 ) ); my $overdues = Koha::Patrons->find( $patron->id )->overdues; # Koha::Patron->overdues prefetches my $overdue = $overdues->next->unblessed_all_relateds; is( $overdue->{issue_id}, $issue->issue_id, 'unblessed_all_relateds has field from the original table (issues)' ); -- 2.39.5