|
Lines 228-234
subtest 'build_authorities_query_compat() tests' => sub {
Link Here
|
| 228 |
}; |
228 |
}; |
| 229 |
|
229 |
|
| 230 |
subtest 'build_query tests' => sub { |
230 |
subtest 'build_query tests' => sub { |
| 231 |
plan tests => 68; |
231 |
plan tests => 69; |
| 232 |
|
232 |
|
| 233 |
my $qb; |
233 |
my $qb; |
| 234 |
|
234 |
|
|
Lines 245-251
subtest 'build_query tests' => sub {
Link Here
|
| 245 |
|
245 |
|
| 246 |
is_deeply( |
246 |
is_deeply( |
| 247 |
$query->{sort}, |
247 |
$query->{sort}, |
| 248 |
[ { 'title__sort' => { 'order' => 'asc' } } ], |
248 |
[ { 'title__sort' => { 'order' => 'asc' } }, { 'local-number' => { 'order' => 'desc' } } ], |
| 249 |
"sort parameter properly formed" |
249 |
"sort parameter properly formed" |
| 250 |
); |
250 |
); |
| 251 |
|
251 |
|
|
Lines 267-272
subtest 'build_query tests' => sub {
Link Here
|
| 267 |
$query = $qb->build_query( 'test', %options ); |
267 |
$query = $qb->build_query( 'test', %options ); |
| 268 |
ok( !defined $query->{aggregations}, 'Skipping facets means we do not have aggregations in the the query' ); |
268 |
ok( !defined $query->{aggregations}, 'Skipping facets means we do not have aggregations in the the query' ); |
| 269 |
|
269 |
|
|
|
270 |
$query = $qb->build_query( 'test', () ); |
| 271 |
|
| 272 |
is_deeply( |
| 273 |
$query->{sort}, |
| 274 |
[ |
| 275 |
{ '_score' => { 'order' => 'desc' } }, |
| 276 |
{ 'local-number' => { 'order' => 'desc' } } |
| 277 |
], |
| 278 |
"sort parameter properly formed if no sort passed" |
| 279 |
); |
| 280 |
|
| 270 |
t::lib::Mocks::mock_preference( 'QueryAutoTruncate', '' ); |
281 |
t::lib::Mocks::mock_preference( 'QueryAutoTruncate', '' ); |
| 271 |
|
282 |
|
| 272 |
( undef, $query ) = $qb->build_query_compat( undef, ['donald duck'] ); |
283 |
( undef, $query ) = $qb->build_query_compat( undef, ['donald duck'] ); |
| 273 |
- |
|
|