Bug 10078: (follow-up) add regression test

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Galen Charlton 2013-10-30 05:02:45 +00:00
parent c767545119
commit a0b042b8a2
1 changed files with 20 additions and 1 deletions

View File

@ -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)'
);
};