5 use Test::More tests => 2;
6 use_ok('Koha::SearchEngine::Zebra::QueryBuilder');
8 subtest 'build_authorities_query' => sub {
12 ['mainmainentry'], ['and'], [''], ['contains'], ['any'], '',
15 my $expected_result = {
16 marclist => ['mainmainentry'],
19 operator => ['contains'],
22 orderby => 'HeadingAsc',
25 Koha::SearchEngine::Zebra::QueryBuilder->build_authorities_query( @test_search );
27 $built_search, $expected_result,
28 "We are simply hashifying our array of refs/values, should otherwise not be altered"
30 $expected_result->{value} = ['"any"'];
31 $test_search[4] = ['"any"'];
33 Koha::SearchEngine::Zebra::QueryBuilder->build_authorities_query( @test_search );
35 $built_search, $expected_result,
36 "The same should hold true if the search contains double quotes which will be escaped during searching by search_auth_compat subroutine"