View | Details | Raw Unified | Return to bug 14778
Collapse All | Expand All

(-)a/t/lib/Mocks.pm (-6 / +4 lines)
Lines 3-9 package t::lib::Mocks; Link Here
3
use Modern::Perl;
3
use Modern::Perl;
4
use C4::Context;
4
use C4::Context;
5
5
6
use DBD::Mock;
6
use Koha::Schema;
7
use Test::MockModule;
7
use Test::MockModule;
8
8
9
my %configs;
9
my %configs;
Lines 39-48 sub mock_preference { Link Here
39
}
39
}
40
40
41
sub mock_dbh {
41
sub mock_dbh {
42
    my $context = new Test::MockModule('C4::Context');
42
    our $context = new Test::MockModule('Koha::Database');
43
    $context->mock( '_new_dbh', sub {
43
    $context->mock( '_new_schema', sub {
44
        my $dbh = DBI->connect( 'DBI:Mock:', '', '' )
44
        my $dbh = Koha::Schema->connect( 'DBI:Mock:', '', '' );
45
          || die "Cannot create handle: $DBI::errstr\n";
46
        return $dbh;
45
        return $dbh;
47
    } );
46
    } );
48
    return $context;
47
    return $context;
49
- 

Return to bug 14778