Lines 216-222
subtest 'build_authorities_query_compat() tests' => sub {
Link Here
|
216 |
}; |
216 |
}; |
217 |
|
217 |
|
218 |
subtest 'build_query tests' => sub { |
218 |
subtest 'build_query tests' => sub { |
219 |
plan tests => 53; |
219 |
plan tests => 54; |
220 |
|
220 |
|
221 |
my $qb; |
221 |
my $qb; |
222 |
|
222 |
|
Lines 238-248
subtest 'build_query tests' => sub {
Link Here
|
238 |
'title__sort' => { |
238 |
'title__sort' => { |
239 |
'order' => 'asc' |
239 |
'order' => 'asc' |
240 |
} |
240 |
} |
241 |
} |
241 |
}, |
|
|
242 |
{ |
243 |
'local-number.raw' => { |
244 |
'order' => 'desc' |
245 |
} |
246 |
} |
242 |
], |
247 |
], |
243 |
"sort parameter properly formed" |
248 |
"sort parameter properly formed" |
244 |
); |
249 |
); |
245 |
|
250 |
|
|
|
251 |
$query = $qb->build_query('test', () ); |
252 |
|
253 |
is_deeply( |
254 |
$query->{sort}, |
255 |
[ |
256 |
{ |
257 |
'_score' => { |
258 |
'order' => 'desc' |
259 |
} |
260 |
}, |
261 |
{ |
262 |
'local-number.raw' => { |
263 |
'order' => 'desc' |
264 |
} |
265 |
} |
266 |
], |
267 |
"sort parameter properly formed if no sort passed" |
268 |
); |
269 |
|
246 |
t::lib::Mocks::mock_preference('FacetMaxCount','37'); |
270 |
t::lib::Mocks::mock_preference('FacetMaxCount','37'); |
247 |
t::lib::Mocks::mock_preference('DisplayLibraryFacets','both'); |
271 |
t::lib::Mocks::mock_preference('DisplayLibraryFacets','both'); |
248 |
$query = $qb->build_query('test', %options); |
272 |
$query = $qb->build_query('test', %options); |
249 |
- |
|
|