Bug 14097 : Avoid issue if the number of syspref shared is modified

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit e3e507be9e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This commit is contained in:
Julian FIOL 2015-08-24 13:50:16 +02:00 committed by Julian Maurice
parent a9efe8521f
commit 00fbd8877e
1 changed files with 5 additions and 3 deletions

View File

@ -15,7 +15,7 @@
# with Koha; if not, see <http://www.gnu.org/licenses>.
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 ---------------------