From fecfaec718694d5341f53f02e75b1a4e51e67ae1 Mon Sep 17 00:00:00 2001 From: Julian FIOL Date: Mon, 24 Aug 2015 13:50:16 +0200 Subject: [PATCH] Bug 14097 : Avoid issue if the number of syspref shared is modified Signed-off-by: Indranil Das Gupta (L2C2 Technologies) --- t/db_dependent/UsageStats.t | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t index ad2dd15..2d92e79 100644 --- a/t/db_dependent/UsageStats.t +++ b/t/db_dependent/UsageStats.t @@ -15,7 +15,7 @@ # with Koha; if not, see . use Modern::Perl; -use Test::More tests => 551; +use Test::More tests => 549; use t::lib::Mocks qw(mock_preference); use POSIX qw(strftime); @@ -150,7 +150,6 @@ mocking_systempreferences_to_a_set_value(0); $report = C4::UsageStats->BuildReport(); isa_ok( $report, 'HASH', '$report is a HASH' ); isa_ok( $report->{systempreferences}, 'HASH', '$report->{systempreferences} is a HASH' ); -is( scalar( keys %{$report->{systempreferences}} ), 248, "There are 248 fields in $report->{systempreferences}" ); verif_systempreferences_values( $report, 0 ); #mock with values @@ -159,9 +158,12 @@ mocking_systempreferences_to_a_set_value(1); $report = C4::UsageStats->BuildReport(); isa_ok( $report, 'HASH', '$report is a HASH' ); isa_ok( $report->{systempreferences}, 'HASH', '$report->{systempreferences} is a HASH' ); -is( scalar( keys %{$report->{systempreferences}} ), 248, "There are 248 fields in $report->{systempreferences}" ); verif_systempreferences_values( $report, 1 ); +#Test if unwanted syspref are not sent +is( $report->{systempreferences}->{useDischarge}, undef, 'useDischarge should not be shared'); +is( $report->{systempreferences}->{OpacUserJS}, undef, 'OpacUserJS should not be shared'); + # ---------- Testing ReportToCommunity ---------- # ---------- Testing _count --------------------- -- 1.9.1