Lines 8-14
use_ok('Koha::SearchEngine::Zebra::QueryBuilder');
Link Here
|
8 |
subtest 'build_authorities_query' => sub { |
8 |
subtest 'build_authorities_query' => sub { |
9 |
plan tests => 2; |
9 |
plan tests => 2; |
10 |
|
10 |
|
11 |
my @test_search = (['mainmainentry'],['and'],[''],['contains'],['any'],'','HeadingAsc'); |
11 |
my @test_search = ( |
|
|
12 |
['mainmainentry'], ['and'], [''], ['contains'], ['any'], '', |
13 |
'HeadingAsc' |
14 |
); |
12 |
my $expected_result = { |
15 |
my $expected_result = { |
13 |
marclist => ['mainmainentry'], |
16 |
marclist => ['mainmainentry'], |
14 |
and_or => ['and'], |
17 |
and_or => ['and'], |
Lines 18-29
subtest 'build_authorities_query' => sub {
Link Here
|
18 |
authtypecode => '', |
21 |
authtypecode => '', |
19 |
orderby => 'HeadingAsc', |
22 |
orderby => 'HeadingAsc', |
20 |
}; |
23 |
}; |
21 |
my $built_search = Koha::SearchEngine::Zebra::QueryBuilder->build_authorities_query(@test_search); |
24 |
my $built_search = |
22 |
is_deeply( $built_search, $expected_result, "We are simply hashifying our array of refs/values, should otherwise not be altered" ); |
25 |
Koha::SearchEngine::Zebra::QueryBuilder->build_authorities_query( @test_search ); |
|
|
26 |
is_deeply( |
27 |
$built_search, $expected_result, |
28 |
"We are simply hashifying our array of refs/values, should otherwise not be altered" |
29 |
); |
23 |
$expected_result->{value} = ['"any"']; |
30 |
$expected_result->{value} = ['"any"']; |
24 |
$test_search[4] = ['"any"']; |
31 |
$test_search[4] = ['"any"']; |
25 |
$built_search = Koha::SearchEngine::Zebra::QueryBuilder->build_authorities_query(@test_search); |
32 |
$built_search = |
26 |
warn Data::Dumper::Dumper( $built_search, $expected_result ); |
33 |
Koha::SearchEngine::Zebra::QueryBuilder->build_authorities_query( @test_search ); |
27 |
is_deeply( $built_search, $expected_result, "The same should hold true if the search contains double quotes which will be escaped during searching by search_auth_compat subroutine" ); |
34 |
is_deeply( |
|
|
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" |
37 |
); |
28 |
}; |
38 |
}; |
29 |
|
39 |
|
30 |
- |
|
|