View | Details | Raw Unified | Return to bug 36798
Collapse All | Expand All

(-)a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t (-2 / +28 lines)
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 => 57;
222
    plan tests => 60;
223
223
224
    my $qb;
224
    my $qb;
225
225
Lines 449-454 subtest 'build_query tests' => sub { Link Here
449
        "query of boolean type field is not truncated even if QueryAutoTruncate is set"
449
        "query of boolean type field is not truncated even if QueryAutoTruncate is set"
450
    );
450
    );
451
451
452
    # Reset SearchCancelAndInvalidISBNandISSN syspref
453
    t::lib::Mocks::mock_preference( 'SearchCancelAndInvalidISBNandISSN', '0' );
454
455
    ( undef, $query ) = $qb->build_query_compat( undef, ['nb:"9780141930848"'] );
456
    is(
457
        $query->{query}{query_string}{query},
458
        '(isbn:"9780141930848")',
459
        "nb query transformed into isbn search field"
460
    );
461
462
    # Set SearchCancelAndInvalidISBNandISSN syspref
463
    t::lib::Mocks::mock_preference( 'SearchCancelAndInvalidISBNandISSN', '1' );
464
465
    ( undef, $query ) = $qb->build_query_compat( undef, ['nb:"9780141930848"'] );
466
    is(
467
        $query->{query}{query_string}{query},
468
        '(isbn-all:"9780141930848")',
469
        "nb query transformed into isbn-all search field"
470
    );
471
472
    ( undef, $query ) = $qb->build_query_compat( undef, ['nb:"9780141930848" ns:"1089-6891"'] );
473
    is(
474
        $query->{query}{query_string}{query},
475
        '(isbn-all:"9780141930848" issn-all:"1089-6891")',
476
        "nb and ns query transformed into isbn-all and issn-all search field"
477
    );
478
452
    ( undef, $query ) = $qb->build_query_compat( undef, ['J.R.R'] );
479
    ( undef, $query ) = $qb->build_query_compat( undef, ['J.R.R'] );
453
    is(
480
    is(
454
        $query->{query}{query_string}{query},
481
        $query->{query}{query_string}{query},
455
- 

Return to bug 36798