Lines 20-27
use Modern::Perl;
Link Here
|
20 |
use Test::More; |
20 |
use Test::More; |
21 |
use File::Spec; |
21 |
use File::Spec; |
22 |
use File::Find; |
22 |
use File::Find; |
23 |
use Test::MockModule; |
23 |
|
24 |
use DBD::Mock; |
24 |
use t::lib::Mocks; |
25 |
|
25 |
|
26 |
=head1 DESCRIPTION |
26 |
=head1 DESCRIPTION |
27 |
|
27 |
|
Lines 29-41
use DBD::Mock;
Link Here
|
29 |
|
29 |
|
30 |
=cut |
30 |
=cut |
31 |
|
31 |
|
32 |
# Mock the DB connexion and C4::Context |
32 |
my $context_module = t::lib::Mocks::mock_dbh; |
33 |
my $context = new Test::MockModule('C4::Context'); |
|
|
34 |
$context->mock( '_new_dbh', sub { |
35 |
my $dbh = DBI->connect( 'DBI:Mock:', '', '' ) |
36 |
|| die "Cannot create handle: $DBI::errstr\n"; |
37 |
return $dbh; |
38 |
}); |
39 |
|
33 |
|
40 |
# Loop through the C4:: modules |
34 |
# Loop through the C4:: modules |
41 |
my $lib = File::Spec->rel2abs('C4'); |
35 |
my $lib = File::Spec->rel2abs('C4'); |