From a0b042b8a276ddacf3be13fa1666454b9b1d3903 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 30 Oct 2013 05:02:45 +0000 Subject: [PATCH] Bug 10078: (follow-up) add regression test Signed-off-by: Galen Charlton --- t/db_dependent/Koha.t | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t index 16ef67d97f..0e90403213 100644 --- a/t/db_dependent/Koha.t +++ b/t/db_dependent/Koha.t @@ -8,7 +8,7 @@ use warnings; use C4::Context; use Koha::DateUtils qw(dt_from_string); -use Test::More tests => 6; +use Test::More tests => 7; use DateTime::Format::MySQL; BEGIN { @@ -242,3 +242,22 @@ subtest 'Date and ISBN tests' => sub { '0321496949', '_isbn_cleanup converts ISBN-13 to ISBN-10' ); }; + +subtest 'getFacets() tests' => sub { + plan tests => 2; + + C4::Context->set_preference('singleBranchMode', 0); + my $facets = C4::Koha::getFacets(); + is( + scalar( grep { defined $_->{idx} && $_->{idx} eq 'location' } @$facets ), + 1, + 'location facet present with singleBranchMode off (bug 10078)' + ); + C4::Context->set_preference('singleBranchMode', 1); + $facets = C4::Koha::getFacets(); + is( + scalar( grep { defined $_->{idx} && $_->{idx} eq 'location' } @$facets ), + 1, + 'location facet present with singleBranchMode on (bug 10078)' + ); +}; -- 2.39.5