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