From 42cd23ceb908fa23dc49dc228d1b54e5b50c3d15 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 28 Sep 2016 13:37:05 +0100 Subject: [PATCH] Bug 15131: Add AllowItemsOnHoldCheckoutSCO to UsageStats Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- C4/UsageStats.pm | 1 + t/db_dependent/UsageStats.t | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index b8dbb268ae..cf8b98eb9d 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -121,6 +121,7 @@ sub BuildReport { AllFinesNeedOverride AllowFineOverride AllowItemsOnHoldCheckout + AllowItemsOnHoldCheckoutSCO AllowNotForLoanOverride AllowRenewalLimitOverride AllowReturnToBranch diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t index 76abe497f3..bb15e88279 100644 --- a/t/db_dependent/UsageStats.t +++ b/t/db_dependent/UsageStats.t @@ -15,9 +15,10 @@ # with Koha; if not, see . use Modern::Perl; -use Test::More tests => 545; +use Test::More tests => 57; use t::lib::Mocks qw(mock_preference); use POSIX qw(strftime); +use Data::Dumper; BEGIN { use_ok('C4::UsageStats'); @@ -372,6 +373,7 @@ sub mocking_systempreferences_to_a_set_value { AllFinesNeedOverride AllowFineOverride AllowItemsOnHoldCheckout + AllowItemsOnHoldCheckoutSCO AllowNotForLoanOverride AllowRenewalLimitOverride AllowReturnToBranch @@ -586,8 +588,17 @@ sub mocking_systempreferences_to_a_set_value { sub verif_systempreferences_values { my ( $report, $value_to_test ) = @_; + my @missings; foreach my $key ( keys %{$report->{systempreferences}} ) { - is( $report->{systempreferences}->{$key}, $value_to_test, "\$report->{systempreferences}->{$key} = $value_to_test" ); + if ( $report->{systempreferences}->{$key} ne $value_to_test ) { + warn $key; + push @missings, $key; + } + } + unless ( @missings ) { + ok(1, 'All prefs are present'); + } else { + ok(0, 'Some prefs are missing: ' . Dumper(\@missings)); } } -- 2.39.5