@@ -, +, @@ --- t/db_dependent/Sitemapper.t | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/t/db_dependent/Sitemapper.t +++ a/t/db_dependent/Sitemapper.t @@ -23,6 +23,7 @@ use File::Basename; use File::Path; use DateTime; use Test::More tests => 14; +use Koha::Schema; BEGIN { @@ -43,12 +44,13 @@ sub slurp { # Create 3 mocked dataset to be used by Koha::Sitemaper in place of DB content my $module_context = new Test::MockModule('C4::Context'); -$module_context->mock('_new_dbh', sub { - my $dbh = DBI->connect( 'DBI:Mock:', '', '' ) - || die "Cannot create handle: $DBI::errstr\n"; +$module_context->mock('dbh', sub { + my $schema = Koha::Schema->connect( 'dbi:Mock:', '', '' ); + my $dbh = $schema->storage->dbh + || die "Cannot create handle\n"; return $dbh }); -my $dbh = C4::Context->dbh(); +my $dbh = C4::Context->dbh; my $two_bibs = [ [ qw/ biblionumber timestamp / ], [ qw/ 1234 2013-11-15 / ], --