projects
/
koha_fer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'origin/new/bug_6328'
[koha_fer]
/
t
/
db_dependent
/
XISBN.t
diff --git
a/t/db_dependent/XISBN.t
b/t/db_dependent/XISBN.t
index
8f5c8bd
..
a3c5c6d
100755
(executable)
--- a/
t/db_dependent/XISBN.t
+++ b/
t/db_dependent/XISBN.t
@@
-5,7
+5,7
@@
use strict;
use warnings;
use strict;
use warnings;
-use Test::Class::Load qw ( t/db_dependent/ );
+
#
use Test::Class::Load qw ( t/db_dependent/ );
use Test::More tests => 4;
use MARC::Record;
use C4::Biblio;
use Test::More tests => 4;
use MARC::Record;
use C4::Biblio;
@@
-17,8
+17,8
@@
BEGIN {
use_ok('C4::XISBN');
}
use_ok('C4::XISBN');
}
-KohaTest::clear_test_database();
-KohaTest::create_test_database();
+
#
KohaTest::clear_test_database();
+
#
KohaTest::create_test_database();
my $isbn = '0590353403';
my $isbn2 = '0747554560';
my $isbn = '0590353403';
my $isbn2 = '0747554560';
@@
-31,18
+31,21
@@
my($biblionumber,$biblioitemnumber) = AddBiblio($marc_record,'');
my $marc_record=MARC::Record->new;
my $field = MARC::Field->new('020','','','a' => $isbn2);
$marc_record->append_fields($field);
my $marc_record=MARC::Record->new;
my $field = MARC::Field->new('020','','','a' => $isbn2);
$marc_record->append_fields($field);
-my($biblionumber
,$biblioitemnumber
) = AddBiblio($marc_record,'');
+my($biblionumber
2,$biblioitemnumber2
) = AddBiblio($marc_record,'');
my $trial = C4::XISBN::get_biblionumber_from_isbn($isbn);
my $trial = C4::XISBN::get_biblionumber_from_isbn($isbn);
-is($trial->[0]->{biblionumber},
1
,"It gets the correct biblionumber from the only isbn we have added.");
+is($trial->[0]->{biblionumber},
$biblionumber
,"It gets the correct biblionumber from the only isbn we have added.");
$trial = C4::XISBN::_get_biblio_from_xisbn($isbn);
$trial = C4::XISBN::_get_biblio_from_xisbn($isbn);
-is($trial->{biblionumber},
1
,"Gets biblionumber like the previous test.");
+is($trial->{biblionumber},
$biblionumber
,"Gets biblionumber like the previous test.");
-# doesn't work yet;
my $context = C4::Context->new();
$context->set_preference('ThingISBN','on');
diag C4::Context::preference('ThingISBN');
my $var = C4::XISBN::get_xisbns($isbn);
my $context = C4::Context->new();
$context->set_preference('ThingISBN','on');
diag C4::Context::preference('ThingISBN');
my $var = C4::XISBN::get_xisbns($isbn);
-is($var->[0]->{biblionumber},2,"Gets correct biblionumber from a book with a similar isbn.");
+is($var->[0]->{biblionumber},$biblionumber2,"Gets correct biblionumber from a book with a similar isbn.");
+
+# clean up after ourselves
+DelBiblio($biblionumber);
+DelBiblio($biblionumber2);
\ No newline at end of file