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

(-)a/Koha/Z3950Responder/RPN.pm (+1 lines)
Lines 45-50 sub to_koha { Link Here
45
    my $prefix = '';
45
    my $prefix = '';
46
    my $suffix = '';
46
    my $suffix = '';
47
    my $term = $self->{'term'};
47
    my $term = $self->{'term'};
48
    utf8::decode($term);
48
49
49
    if ($attrs) {
50
    if ($attrs) {
50
        foreach my $attr (@$attrs) {
51
        foreach my $attr (@$attrs) {
(-)a/t/db_dependent/Koha/Z3950Responder/GenericSession.t (-4 / +4 lines)
Lines 1-6 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
use utf8;
4
5
5
use Test::More tests => 3;
6
use Test::More tests => 3;
6
use Test::WWW::Mechanize;
7
use Test::WWW::Mechanize;
Lines 74-80 subtest 'test_search' => sub { Link Here
74
    $search->mock('simple_search_compat', sub {
75
    $search->mock('simple_search_compat', sub {
75
        my ( $self, $query ) = @_;
76
        my ( $self, $query ) = @_;
76
77
77
        return ('unexpected query', undef, 0) unless $query eq '((author:(author)) AND ((title:(title\(s\))) OR (title:(another))))';
78
        return ('unexpected query', undef, 0) unless $query eq '((author:(author)) AND ((title:(title\(s\))) OR (title:(speciäl))))';
78
79
79
        my @records = ($marc_record_1, $marc_record_2);
80
        my @records = ($marc_record_1, $marc_record_2);
80
        return (undef, \@records, 2);
81
        return (undef, \@records, 2);
Lines 103-109 subtest 'test_search' => sub { Link Here
103
    $Zconn->connect('localhost:42111', 0);
104
    $Zconn->connect('localhost:42111', 0);
104
    is($Zconn->errcode(), 0, 'Connection is successful: ' . $Zconn->errmsg());
105
    is($Zconn->errcode(), 0, 'Connection is successful: ' . $Zconn->errmsg());
105
106
106
    my $rs = $Zconn->search_pqf('@and @attr 1=1 @attr 4=1 author @or @attr 1=4 title(s) @attr 1=4 another');
107
    my $rs = $Zconn->search_pqf('@and @attr 1=1 @attr 4=1 author @or @attr 1=4 title(s) @attr 1=4 speciäl');
107
    is($Zconn->errcode(), 0, 'Search is successful: ' . $Zconn->errmsg());
108
    is($Zconn->errcode(), 0, 'Search is successful: ' . $Zconn->errmsg());
108
109
109
    is($rs->size(), 2, 'Two results returned');
110
    is($rs->size(), 2, 'Two results returned');
Lines 132-138 subtest 'test_search' => sub { Link Here
132
    @nodes = $dom->getElementsByTagNameNS($ns, 'diagnostics');
133
    @nodes = $dom->getElementsByTagNameNS($ns, 'diagnostics');
133
    is(scalar(@nodes), 1, 'diagnostics returned for bad query');
134
    is(scalar(@nodes), 1, 'diagnostics returned for bad query');
134
135
135
    $agent->get_ok("$base/biblios?operation=searchRetrieve&recordSchema=marcxml&version=1.1&maximumRecords=10&query=(dc.author%3dauthor AND (dc.title%3d\"title(s)\" OR dc.title%3danother))", 'Retrieve search results');
136
    $agent->get_ok("$base/biblios?operation=searchRetrieve&recordSchema=marcxml&version=1.1&maximumRecords=10&query=(dc.author%3dauthor AND (dc.title%3d\"title(s)\" OR dc.title%3dspeciäl))", 'Retrieve search results');
136
    $dom = XML::LibXML->load_xml(string => $agent->content());
137
    $dom = XML::LibXML->load_xml(string => $agent->content());
137
    @nodes = $dom->getElementsByTagNameNS($ns, 'searchRetrieveResponse');
138
    @nodes = $dom->getElementsByTagNameNS($ns, 'searchRetrieveResponse');
138
    is(scalar(@nodes), 1, 'searchRetrieveResponse returned');
139
    is(scalar(@nodes), 1, 'searchRetrieveResponse returned');
139
- 

Return to bug 13937