Lines 23-28
use File::Basename;
Link Here
|
23 |
use File::Path; |
23 |
use File::Path; |
24 |
use DateTime; |
24 |
use DateTime; |
25 |
use Test::More tests => 14; |
25 |
use Test::More tests => 14; |
|
|
26 |
use Koha::Schema; |
26 |
|
27 |
|
27 |
|
28 |
|
28 |
BEGIN { |
29 |
BEGIN { |
Lines 43-54
sub slurp {
Link Here
|
43 |
|
44 |
|
44 |
# Create 3 mocked dataset to be used by Koha::Sitemaper in place of DB content |
45 |
# Create 3 mocked dataset to be used by Koha::Sitemaper in place of DB content |
45 |
my $module_context = new Test::MockModule('C4::Context'); |
46 |
my $module_context = new Test::MockModule('C4::Context'); |
46 |
$module_context->mock('_new_dbh', sub { |
47 |
$module_context->mock('dbh', sub { |
47 |
my $dbh = DBI->connect( 'DBI:Mock:', '', '' ) |
48 |
my $schema = Koha::Schema->connect( 'dbi:Mock:', '', '' ); |
48 |
|| die "Cannot create handle: $DBI::errstr\n"; |
49 |
my $dbh = $schema->storage->dbh |
|
|
50 |
|| die "Cannot create handle\n"; |
49 |
return $dbh |
51 |
return $dbh |
50 |
}); |
52 |
}); |
51 |
my $dbh = C4::Context->dbh(); |
53 |
my $dbh = C4::Context->dbh; |
52 |
my $two_bibs = [ |
54 |
my $two_bibs = [ |
53 |
[ qw/ biblionumber timestamp / ], |
55 |
[ qw/ biblionumber timestamp / ], |
54 |
[ qw/ 1234 2013-11-15 / ], |
56 |
[ qw/ 1234 2013-11-15 / ], |
55 |
- |
|
|