Lines 5-25
Link Here
|
5 |
|
5 |
|
6 |
use Modern::Perl; |
6 |
use Modern::Perl; |
7 |
|
7 |
|
8 |
# use Test::Class::Load qw ( t/db_dependent/ ); |
|
|
9 |
use Test::More tests => 5; |
8 |
use Test::More tests => 5; |
10 |
use MARC::Record; |
9 |
use MARC::Record; |
11 |
use C4::Biblio; |
10 |
use C4::Biblio; |
12 |
use C4::XISBN; |
11 |
use C4::XISBN; |
13 |
use Data::Dumper; |
|
|
14 |
use C4::Context; |
12 |
use C4::Context; |
|
|
13 |
use Test::MockModule; |
15 |
|
14 |
|
16 |
BEGIN { |
15 |
BEGIN { |
17 |
use_ok('C4::XISBN'); |
16 |
use_ok('C4::XISBN'); |
18 |
} |
17 |
} |
19 |
|
18 |
|
20 |
# Avoid "redefined subroutine" warnings |
19 |
my $dbh = C4::Context->dbh; |
21 |
local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /redefined/ }; |
20 |
$dbh->{RaiseError} = 1; |
22 |
*C4::Search::SimpleSearch = \&Mock_SimpleSearch; |
21 |
$dbh->{AutoCommit} = 0; |
|
|
22 |
|
23 |
my $search_module = new Test::MockModule('C4::Search'); |
24 |
|
25 |
$search_module->mock('SimpleSearch', \&Mock_SimpleSearch ); |
23 |
|
26 |
|
24 |
my $context = C4::Context->new; |
27 |
my $context = C4::Context->new; |
25 |
|
28 |
|
Lines 62-72
is( $results_xisbn->[0]->{biblionumber},
Link Here
|
62 |
$biblionumber3, |
65 |
$biblionumber3, |
63 |
"Gets correct biblionumber from a book with a similar isbn using XISBN." ); |
66 |
"Gets correct biblionumber from a book with a similar isbn using XISBN." ); |
64 |
|
67 |
|
65 |
# clean up after ourselves |
|
|
66 |
DelBiblio($biblionumber1); |
67 |
DelBiblio($biblionumber2); |
68 |
DelBiblio($biblionumber3); |
69 |
|
70 |
# Util subs |
68 |
# Util subs |
71 |
|
69 |
|
72 |
# Add new biblio with isbn and return biblionumber |
70 |
# Add new biblio with isbn and return biblionumber |
73 |
- |
|
|