Lines 116-124
subtest "Handle search filters" => sub {
Link Here
|
116 |
|
116 |
|
117 |
my ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] ); |
117 |
my ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] ); |
118 |
|
118 |
|
119 |
is( $limit,q{kw=(cat) AND ti=(bat) OR au=(rat) and (mc-itype,phr=BK or mc-itype,phr=MU) and (( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) ))},"Limit correctly formed"); |
119 |
is( $limit,q{(kw=(cat) AND ti=(bat) OR au=(rat)) and (mc-itype,phr=BK or mc-itype,phr=MU) and (( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) ))},"Limit correctly formed"); |
120 |
is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded"); |
120 |
is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded"); |
121 |
is( $limit_desc,q{kw=(cat) AND ti=(bat) OR au=(rat) and (mc-itype,phr=BK or mc-itype,phr=MU) and (( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) ))},"Limit description is correctly expanded"); |
121 |
is( $limit_desc,q{(kw=(cat) AND ti=(bat) OR au=(rat)) and (mc-itype,phr=BK or mc-itype,phr=MU) and (( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) ))},"Limit description is correctly expanded"); |
122 |
|
122 |
|
123 |
$filter = Koha::SearchFilter->new({ |
123 |
$filter = Koha::SearchFilter->new({ |
124 |
name => "test", |
124 |
name => "test", |
Lines 129-136
subtest "Handle search filters" => sub {
Link Here
|
129 |
|
129 |
|
130 |
( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] ); |
130 |
( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] ); |
131 |
|
131 |
|
132 |
is( $limit,q{(su=biography)},"Limit correctly formed for ccl type query"); |
132 |
is( $limit,q{((su=biography))},"Limit correctly formed for ccl type query"); |
133 |
is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded"); |
133 |
is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded"); |
134 |
is( $limit_desc,q{(su=biography)},"Limit description is correctly handled for ccl type query"); |
134 |
is( $limit_desc,q{((su=biography))},"Limit description is correctly handled for ccl type query"); |
135 |
|
135 |
|
136 |
}; |
136 |
}; |
137 |
- |
|
|