|
Lines 191-199
sub run_tests {
Link Here
|
| 191 |
"(GetMarcISBN) Corretly retrieves ISBN #". ($i + 1)); |
191 |
"(GetMarcISBN) Corretly retrieves ISBN #". ($i + 1)); |
| 192 |
} |
192 |
} |
| 193 |
|
193 |
|
| 194 |
|
|
|
| 195 |
is( GetMarcPrice( $record_for_isbn, $marcflavour ), 100, |
194 |
is( GetMarcPrice( $record_for_isbn, $marcflavour ), 100, |
| 196 |
"GetMarcPrice returns the correct value"); |
195 |
"GetMarcPrice returns the correct value"); |
|
|
196 |
|
| 197 |
# test for GetMarcNotes |
| 198 |
my $a1= GetMarcNotes( $marc_record, $marcflavour ); |
| 199 |
my $field2 = MARC::Field->new( $marcflavour eq 'UNIMARC'? 300: 555, 0, '', a=> 'Some text', u=> 'http://url-1.com', u=> 'nohttp://something_else' ); |
| 200 |
$marc_record->append_fields( $field2 ); |
| 201 |
my $a2= GetMarcNotes( $marc_record, $marcflavour ); |
| 202 |
my $last= @$a2? $a2->[@$a2-1]->{marcnote}: ''; |
| 203 |
is( @$a2 == @$a1 + 1 && ( |
| 204 |
( $marcflavour eq 'UNIMARC' && $last eq $field2->as_string() ) || |
| 205 |
( $marcflavour ne 'UNIMARC' && $last =~ /\<a href=/ )), |
| 206 |
1, 'Test for GetMarcNotes' ); |
| 197 |
} |
207 |
} |
| 198 |
|
208 |
|
| 199 |
sub mock_marcfromkohafield { |
209 |
sub mock_marcfromkohafield { |
|
Lines 260-278
sub create_issn_field {
Link Here
|
| 260 |
} |
270 |
} |
| 261 |
|
271 |
|
| 262 |
subtest 'MARC21' => sub { |
272 |
subtest 'MARC21' => sub { |
| 263 |
plan tests => 27; |
273 |
plan tests => 28; |
| 264 |
run_tests('MARC21'); |
274 |
run_tests('MARC21'); |
| 265 |
$dbh->rollback; |
275 |
$dbh->rollback; |
| 266 |
}; |
276 |
}; |
| 267 |
|
277 |
|
| 268 |
subtest 'UNIMARC' => sub { |
278 |
subtest 'UNIMARC' => sub { |
| 269 |
plan tests => 27; |
279 |
plan tests => 28; |
| 270 |
run_tests('UNIMARC'); |
280 |
run_tests('UNIMARC'); |
| 271 |
$dbh->rollback; |
281 |
$dbh->rollback; |
| 272 |
}; |
282 |
}; |
| 273 |
|
283 |
|
| 274 |
subtest 'NORMARC' => sub { |
284 |
subtest 'NORMARC' => sub { |
| 275 |
plan tests => 27; |
285 |
plan tests => 28; |
| 276 |
run_tests('NORMARC'); |
286 |
run_tests('NORMARC'); |
| 277 |
$dbh->rollback; |
287 |
$dbh->rollback; |
| 278 |
}; |
288 |
}; |
| 279 |
- |
|
|