Lines 18-33
Link Here
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 3; |
20 |
use Test::More tests => 3; |
21 |
use Test::MockModule; |
21 |
use t::lib::Mocks; |
22 |
use DBD::Mock; |
|
|
23 |
|
22 |
|
24 |
# Mock the DB connexion and C4::Context |
23 |
# Mock the DB connexion and C4::Context |
25 |
my $context = new Test::MockModule('C4::Context'); |
24 |
my $context = t::lib::Mocks::mock_dbh; |
26 |
$context->mock( '_new_dbh', sub { |
|
|
27 |
my $dbh = DBI->connect( 'DBI:Mock:', '', '' ) |
28 |
|| die "Cannot create handle: $DBI::errstr\n"; |
29 |
return $dbh; |
30 |
}); |
31 |
|
25 |
|
32 |
use_ok('C4::Search'); |
26 |
use_ok('C4::Search'); |
33 |
can_ok('C4::Search', |
27 |
can_ok('C4::Search', |
34 |
- |
|
|