Lines 55-67
subtest '_do_xslt_proc' => sub {
Link Here
|
55 |
sub test_build_translate_query { |
55 |
sub test_build_translate_query { |
56 |
my $str; |
56 |
my $str; |
57 |
#First pass no parameters |
57 |
#First pass no parameters |
58 |
my @queries= C4::Breeding::_build_query( {} ); |
58 |
my @queries= C4::Breeding::_bib_build_query( {} ); |
59 |
is( defined $queries[0] && $queries[0] eq '' && defined $queries[1] && |
59 |
is( defined $queries[0] && $queries[0] eq '' && defined $queries[1] && |
60 |
$queries[1] eq '', 1, '_build_query gets no parameters'); |
60 |
$queries[1] eq '', 1, '_bib_build_query gets no parameters'); |
61 |
|
61 |
|
62 |
#We now pass one parameter |
62 |
#We now pass one parameter |
63 |
my $pars1= { isbn => '234567' }; |
63 |
my $pars1= { isbn => '234567' }; |
64 |
@queries= C4::Breeding::_build_query( $pars1 ); |
64 |
@queries= C4::Breeding::_bib_build_query( $pars1 ); |
65 |
#Passed only one par: zquery should start with @attr 1=\d+ |
65 |
#Passed only one par: zquery should start with @attr 1=\d+ |
66 |
is( $queries[0] =~ /^\@attr 1=\d+/, 1, 'Z39.50 query with one parameter'); |
66 |
is( $queries[0] =~ /^\@attr 1=\d+/, 1, 'Z39.50 query with one parameter'); |
67 |
$str=$pars1->{isbn}; |
67 |
$str=$pars1->{isbn}; |
Lines 82-88
sub test_build_translate_query {
Link Here
|
82 |
|
82 |
|
83 |
#We now pass two parameters |
83 |
#We now pass two parameters |
84 |
my $pars2= { isbn => '123456', title => 'You should read this.' }; |
84 |
my $pars2= { isbn => '123456', title => 'You should read this.' }; |
85 |
@queries= C4::Breeding::_build_query( $pars2 ); |
85 |
@queries= C4::Breeding::_bib_build_query( $pars2 ); |
86 |
#The Z39.50 query should start with @and (we passed two pars) |
86 |
#The Z39.50 query should start with @and (we passed two pars) |
87 |
is( $queries[0] =~ /^\@and/, 1, 'Second Z39.50 query starts with @and'); |
87 |
is( $queries[0] =~ /^\@and/, 1, 'Second Z39.50 query starts with @and'); |
88 |
#We should also find two @attr 1=\d+ |
88 |
#We should also find two @attr 1=\d+ |
Lines 104-110
sub test_build_translate_query {
Link Here
|
104 |
|
104 |
|
105 |
#We now pass a third wrong parameter (should not make a difference) |
105 |
#We now pass a third wrong parameter (should not make a difference) |
106 |
my $pars3= { isbn => '123456', title => 'You should read this.', xyz => 1 }; |
106 |
my $pars3= { isbn => '123456', title => 'You should read this.', xyz => 1 }; |
107 |
my @queries2= C4::Breeding::_build_query( $pars3 ); |
107 |
my @queries2= C4::Breeding::_bib_build_query( $pars3 ); |
108 |
is( $queries[0] eq $queries2[0] && $queries[1] eq $queries2[1], 1, |
108 |
is( $queries[0] eq $queries2[0] && $queries[1] eq $queries2[1], 1, |
109 |
'Third query makes no difference'); |
109 |
'Third query makes no difference'); |
110 |
|
110 |
|
111 |
- |
|
|