Lines 219-225
subtest 'build_authorities_query_compat() tests' => sub {
Link Here
|
219 |
}; |
219 |
}; |
220 |
|
220 |
|
221 |
subtest 'build_query tests' => sub { |
221 |
subtest 'build_query tests' => sub { |
222 |
plan tests => 61; |
222 |
plan tests => 62; |
223 |
|
223 |
|
224 |
my $qb; |
224 |
my $qb; |
225 |
|
225 |
|
Lines 237-251
subtest 'build_query tests' => sub {
Link Here
|
237 |
is_deeply( |
237 |
is_deeply( |
238 |
$query->{sort}, |
238 |
$query->{sort}, |
239 |
[ |
239 |
[ |
240 |
{ |
240 |
{ 'title__sort' => { 'order' => 'asc' } }, |
241 |
'title__sort' => { |
241 |
{ 'local-number' => { 'order' => 'desc' } } |
242 |
'order' => 'asc' |
|
|
243 |
} |
244 |
} |
245 |
], |
242 |
], |
246 |
"sort parameter properly formed" |
243 |
"sort parameter properly formed" |
247 |
); |
244 |
); |
248 |
|
245 |
|
|
|
246 |
$query = $qb->build_query('test', () ); |
247 |
|
248 |
is_deeply( |
249 |
$query->{sort}, |
250 |
[ |
251 |
{ '_score' => { 'order' => 'desc' } }, |
252 |
{ 'local-number' => { 'order' => 'desc' } } |
253 |
], |
254 |
"sort parameter properly formed if no sort passed" |
255 |
); |
256 |
|
249 |
t::lib::Mocks::mock_preference('FacetMaxCount','37'); |
257 |
t::lib::Mocks::mock_preference('FacetMaxCount','37'); |
250 |
t::lib::Mocks::mock_preference('DisplayLibraryFacets','both'); |
258 |
t::lib::Mocks::mock_preference('DisplayLibraryFacets','both'); |
251 |
$query = $qb->build_query('test', %options); |
259 |
$query = $qb->build_query('test', %options); |
252 |
- |
|
|