Lines 18-29
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 |
|
21 |
use Test::MockModule; |
22 |
BEGIN { |
22 |
use DBD::Mock; |
23 |
use_ok('C4::Search'); |
23 |
|
24 |
can_ok('C4::Search', |
24 |
# Mock the DB connexion and C4::Context |
25 |
qw/_build_initial_query/); |
25 |
my $context = new Test::MockModule('C4::Context'); |
26 |
} |
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 |
|
32 |
use_ok('C4::Search'); |
33 |
can_ok('C4::Search', |
34 |
qw/_build_initial_query/); |
27 |
|
35 |
|
28 |
subtest "_build_initial_query tests" => sub { |
36 |
subtest "_build_initial_query tests" => sub { |
29 |
|
37 |
|
30 |
- |
|
|