3 # This Koha test module is a stub!
4 # Add more tests here!!!
8 use Test::Class::Load qw ( . );
9 use Test::More tests => 4;
20 KohaTest::clear_test_database();
21 KohaTest::create_test_database();
23 my $isbn = '0590353403';
24 my $isbn2 = '0747554560';
26 my $marc_record=MARC::Record->new;
27 my $field = MARC::Field->new('020','','','a' => $isbn);
28 $marc_record->append_fields($field);
29 my($biblionumber,$biblioitemnumber) = AddBiblio($marc_record,'');
31 my $marc_record=MARC::Record->new;
32 my $field = MARC::Field->new('020','','','a' => $isbn2);
33 $marc_record->append_fields($field);
34 my($biblionumber,$biblioitemnumber) = AddBiblio($marc_record,'');
37 my $trial = C4::XISBN::get_biblionumber_from_isbn($isbn);
38 is($trial->[0]->{biblionumber},1,"It gets the correct biblionumber from the only isbn we have added.");
40 $trial = C4::XISBN::_get_biblio_from_xisbn($isbn);
41 is($trial->{biblionumber},1,"Gets biblionumber like the previous test.");
44 my $context = C4::Context->new();
45 $context->set_preference('ThingISBN','on');
46 diag C4::Context::preference('ThingISBN');
47 my $var = C4::XISBN::get_xisbns($isbn);
48 is($var->[0]->{biblionumber},2,"Gets correct biblionumber from a book with a similar isbn.");