Lines 82-88
$se->mock( 'get_elasticsearch_mappings', sub {
Link Here
|
82 |
}); |
82 |
}); |
83 |
|
83 |
|
84 |
subtest 'build_authorities_query_compat() tests' => sub { |
84 |
subtest 'build_authorities_query_compat() tests' => sub { |
85 |
plan tests => 37; |
85 |
plan tests => 38; |
86 |
|
86 |
|
87 |
my $qb; |
87 |
my $qb; |
88 |
|
88 |
|
Lines 168-179
subtest 'build_authorities_query_compat() tests' => sub {
Link Here
|
168 |
"authorities type code is used as filter" |
168 |
"authorities type code is used as filter" |
169 |
); |
169 |
); |
170 |
|
170 |
|
171 |
# Failing case |
171 |
# Authorities marclist check |
172 |
throws_ok { |
172 |
$query = $qb->build_authorities_query_compat( [ 'tomas','mainentry' ], undef, undef, ['contains'], [$search_term,$search_term], 'AUTH_TYPE', 'asc' ); |
173 |
$qb->build_authorities_query_compat( [ 'tomas' ], undef, undef, ['contains'], [$search_term], 'AUTH_TYPE', 'asc' ); |
173 |
is_deeply( |
174 |
} |
174 |
$query->{query}->{bool}->{must}[0]->{query_string}->{default_field}, |
175 |
'Koha::Exceptions::WrongParameter', |
175 |
'tomas', |
176 |
'Exception thrown on invalid value in the marclist param'; |
176 |
"If no mapping for marclist the index is passed through as defined" |
|
|
177 |
); |
178 |
is_deeply( |
179 |
$query->{query}->{bool}->{must}[1]->{query_string}{default_field}, |
180 |
'heading', |
181 |
"If mapping found for marclist the index is passed through converted" |
182 |
); |
183 |
|
177 |
}; |
184 |
}; |
178 |
|
185 |
|
179 |
subtest 'build_query tests' => sub { |
186 |
subtest 'build_query tests' => sub { |
180 |
- |
|
|