Lines 91-97
my $clear_search_fields_cache = sub {
Link Here
|
91 |
}; |
91 |
}; |
92 |
|
92 |
|
93 |
subtest 'build_authorities_query_compat() tests' => sub { |
93 |
subtest 'build_authorities_query_compat() tests' => sub { |
94 |
plan tests => 55; |
94 |
|
|
|
95 |
plan tests => 56; |
95 |
|
96 |
|
96 |
my $qb; |
97 |
my $qb; |
97 |
|
98 |
|
Lines 184-195
subtest 'build_authorities_query_compat() tests' => sub {
Link Here
|
184 |
"authorities type code is used as filter" |
185 |
"authorities type code is used as filter" |
185 |
); |
186 |
); |
186 |
|
187 |
|
187 |
# Failing case |
188 |
# Authorities marclist check |
188 |
throws_ok { |
189 |
$query = $qb->build_authorities_query_compat( [ 'tomas','mainentry' ], undef, undef, ['contains'], [$search_term,$search_term], 'AUTH_TYPE', 'asc' ); |
189 |
$qb->build_authorities_query_compat( [ 'tomas' ], undef, undef, ['contains'], [$search_term], 'AUTH_TYPE', 'asc' ); |
190 |
is_deeply( |
190 |
} |
191 |
$query->{query}->{bool}->{must}[0]->{query_string}->{default_field}, |
191 |
'Koha::Exceptions::WrongParameter', |
192 |
'tomas', |
192 |
'Exception thrown on invalid value in the marclist param'; |
193 |
"If no mapping for marclist the index is passed through as defined" |
|
|
194 |
); |
195 |
is_deeply( |
196 |
$query->{query}->{bool}->{must}[1]->{query_string}{default_field}, |
197 |
'heading', |
198 |
"If mapping found for marclist the index is passed through converted" |
199 |
); |
200 |
|
193 |
}; |
201 |
}; |
194 |
|
202 |
|
195 |
subtest 'build_query tests' => sub { |
203 |
subtest 'build_query tests' => sub { |
196 |
- |
|
|