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 => 58; |
222 |
plan tests => 61; |
223 |
|
223 |
|
224 |
my $qb; |
224 |
my $qb; |
225 |
|
225 |
|
Lines 457-462
subtest 'build_query tests' => sub {
Link Here
|
457 |
"ISBD punctualtion and problematic characters properly removed" |
457 |
"ISBD punctualtion and problematic characters properly removed" |
458 |
); |
458 |
); |
459 |
|
459 |
|
|
|
460 |
# Reset SearchCancelledAndInvalidISBNandISSN syspref |
461 |
t::lib::Mocks::mock_preference( 'SearchCancelledAndInvalidISBNandISSN', '0' ); |
462 |
|
463 |
( undef, $query ) = $qb->build_query_compat( undef, ['nb:"9780141930848"'] ); |
464 |
is( |
465 |
$query->{query}{query_string}{query}, |
466 |
'(isbn:"9780141930848")', |
467 |
"nb query transformed into isbn search field" |
468 |
); |
469 |
|
470 |
# Set SearchCancelledAndInvalidISBNandISSN syspref |
471 |
t::lib::Mocks::mock_preference( 'SearchCancelledAndInvalidISBNandISSN', '1' ); |
472 |
|
473 |
( undef, $query ) = $qb->build_query_compat( undef, ['nb:"9780141930848"'] ); |
474 |
is( |
475 |
$query->{query}{query_string}{query}, |
476 |
'(isbn-all:"9780141930848")', |
477 |
"nb query transformed into isbn-all search field" |
478 |
); |
479 |
|
480 |
( undef, $query ) = $qb->build_query_compat( undef, ['nb:"9780141930848" ns:"1089-6891"'] ); |
481 |
is( |
482 |
$query->{query}{query_string}{query}, |
483 |
'(isbn-all:"9780141930848" issn-all:"1089-6891")', |
484 |
"nb and ns query transformed into isbn-all and issn-all search field" |
485 |
); |
486 |
|
460 |
( undef, $query ) = $qb->build_query_compat( undef, ['J.R.R'] ); |
487 |
( undef, $query ) = $qb->build_query_compat( undef, ['J.R.R'] ); |
461 |
is( |
488 |
is( |
462 |
$query->{query}{query_string}{query}, |
489 |
$query->{query}{query_string}{query}, |
463 |
- |
|
|