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

(-)a/t/Koha/SearchEngine/Elasticsearch/Search.t (-2 / +11 lines)
Lines 24-30 use t::lib::Mocks; Link Here
24
use_ok('Koha::SearchEngine::Elasticsearch::Search');
24
use_ok('Koha::SearchEngine::Elasticsearch::Search');
25
25
26
subtest 'search_auth_compat' => sub {
26
subtest 'search_auth_compat' => sub {
27
    plan tests => 4;
27
    plan tests => 7;
28
28
29
    t::lib::Mocks::mock_preference( 'QueryRegexEscapeOptions', 'dont_escape' );
29
    t::lib::Mocks::mock_preference( 'QueryRegexEscapeOptions', 'dont_escape' );
30
    t::lib::Mocks::mock_preference( 'SearchEngine', 'Elasticsearch' );
30
    t::lib::Mocks::mock_preference( 'SearchEngine', 'Elasticsearch' );
Lines 65-70 subtest 'search_auth_compat' => sub { Link Here
65
            $marc_record->append_fields(
65
            $marc_record->append_fields(
66
                MARC::Field->new( '001', 'Wrong001Number' ),
66
                MARC::Field->new( '001', 'Wrong001Number' ),
67
            );
67
            );
68
            $marc_record->append_fields(
69
                MARC::Field->new(
70
                    '008', '100803t2009    aba|||||  ||| 00| 0     d'
71
                ),
72
            );
68
            return {
73
            return {
69
                hits => {
74
                hits => {
70
                    hits => [
75
                    hits => [
Lines 86-91 subtest 'search_auth_compat' => sub { Link Here
86
91
87
    is( @$results[0]->{authid}, '8675309', 'We get the expected record _id and not the 001' );
92
    is( @$results[0]->{authid}, '8675309', 'We get the expected record _id and not the 001' );
88
93
94
    t::lib::Mocks::mock_preference( 'ShowHeadingUse', 1 );
95
    is( @$results[0]->{main}, 1, 'Valid main heading with ShowHeadingUse' );
96
    is( @$results[0]->{subject},
97
        undef, 'Valid main heading with ShowHeadingUse' );
98
    is( @$results[0]->{series}, 1, 'Valid main heading with ShowHeadingUse' );
89
};
99
};
90
100
91
1;
101
1;
92
- 

Return to bug 33348