From 9663a40b6251aee1df01142485dea3904a57846b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 2 Sep 2025 12:39:36 +0200 Subject: [PATCH] Bug 40680: Fix C4::Calendar imports Attempt to call undefined import method with arguments (new ...) via package C4::Calendar (Perhaps you forgot to load the package?) at t/db_dependent/Hold.t line 25. Signed-off-by: Victor Grousset/tuxayo --- t/db_dependent/Circulation.t | 2 +- t/db_dependent/Circulation/CalcDateDue.t | 2 +- t/db_dependent/Hold.t | 8 +++++--- t/db_dependent/HoldsQueue.t | 2 +- t/db_dependent/Koha/Charges/Fees.t | 2 +- t/db_dependent/Koha/ItemTypes.t | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index ade7d89715..d77906a068 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -34,7 +34,7 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Accounts; -use C4::Calendar qw( new insert_single_holiday insert_week_day_holiday delete_holiday ); +use C4::Calendar; use C4::Circulation qw( AddIssue AddReturn CanBookBeRenewed GetIssuingCharges AddRenewal GetSoonestRenewDate GetLatestAutoRenewDate LostItem GetUpcomingDueIssues CanBookBeIssued AddIssuingCharge MarkIssueReturned ProcessOfflinePayment transferbook ); use C4::Biblio; diff --git a/t/db_dependent/Circulation/CalcDateDue.t b/t/db_dependent/Circulation/CalcDateDue.t index 00e3c99a2c..485b15b818 100755 --- a/t/db_dependent/Circulation/CalcDateDue.t +++ b/t/db_dependent/Circulation/CalcDateDue.t @@ -9,7 +9,7 @@ use DBI; use DateTime; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Calendar qw( new insert_single_holiday delete_holiday insert_week_day_holiday ); +use C4::Calendar; use Koha::DateUtils qw( dt_from_string ); use Koha::Library::Hours; use Koha::CirculationRules; diff --git a/t/db_dependent/Hold.t b/t/db_dependent/Hold.t index 281f32dc18..61babaf78d 100755 --- a/t/db_dependent/Hold.t +++ b/t/db_dependent/Hold.t @@ -22,7 +22,7 @@ use C4::Context; use C4::Biblio qw( AddBiblio ); use Koha::Database; use Koha::Libraries; -use C4::Calendar qw( new insert_single_holiday ); +use C4::Calendar; use Koha::Patrons; use Koha::Holds; use Koha::Item; @@ -356,7 +356,8 @@ subtest "delete() tests" => sub { "Koha::Hold->delete should have deleted the hold" ); - my $number_of_logs = $schema->resultset('ActionLog') + my $number_of_logs = + $schema->resultset('ActionLog') ->search( { module => 'HOLDS', action => 'DELETE', object => $hold->{reserve_id} } )->count; is( $number_of_logs, 0, 'With HoldsLogs, Koha::Hold->delete shouldn\'t have been logged' ); @@ -376,7 +377,8 @@ subtest "delete() tests" => sub { "Koha::Hold->delete should have deleted the hold" ); - $number_of_logs = $schema->resultset('ActionLog') + $number_of_logs = + $schema->resultset('ActionLog') ->search( { module => 'HOLDS', action => 'DELETE', object => $hold->{reserve_id} } )->count; is( $number_of_logs, 1, 'With HoldsLogs, Koha::Hold->delete should have been logged' ); diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t index 0d516da340..b4db63abfe 100755 --- a/t/db_dependent/HoldsQueue.t +++ b/t/db_dependent/HoldsQueue.t @@ -12,7 +12,7 @@ use Test::NoWarnings; use Test::More tests => 65; use Data::Dumper; -use C4::Calendar qw( new insert_single_holiday ); +use C4::Calendar; use C4::Context; use C4::Members; use C4::Circulation qw( AddIssue AddReturn ); diff --git a/t/db_dependent/Koha/Charges/Fees.t b/t/db_dependent/Koha/Charges/Fees.t index 9c9e3a0e05..8d01c2a38b 100755 --- a/t/db_dependent/Koha/Charges/Fees.t +++ b/t/db_dependent/Koha/Charges/Fees.t @@ -29,7 +29,7 @@ use t::lib::TestBuilder; use t::lib::Dates; use Time::Fake; -use C4::Calendar qw( new insert_week_day_holiday delete_holiday ); +use C4::Calendar; use Koha::DateUtils qw(dt_from_string); BEGIN { diff --git a/t/db_dependent/Koha/ItemTypes.t b/t/db_dependent/Koha/ItemTypes.t index 383e274051..63852bceba 100755 --- a/t/db_dependent/Koha/ItemTypes.t +++ b/t/db_dependent/Koha/ItemTypes.t @@ -25,7 +25,7 @@ use Test::More tests => 19; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Calendar qw( new ); +use C4::Calendar; use Koha::Biblioitems; use Koha::Libraries; use Koha::Database; -- 2.51.1.dirty