Bug 13277: (QA followup) use t::lib::Mocks
authorTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 19 Nov 2014 21:05:26 +0000 (18:05 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 19 Nov 2014 21:12:03 +0000 (18:12 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
t/SuggestionEngine_AuthorityFile.t

index 9ffe8f7..ef6eb42 100755 (executable)
@@ -26,15 +26,10 @@ use MARC::Record;
 
 use Test::More;
 use Test::MockModule;
-use DBD::Mock;
+use t::lib::Mocks;
 
 # Mock the DB connexion and C4::Context
-my $context = new Test::MockModule('C4::Context');
-$context->mock( '_new_dbh', sub {
-        my $dbh = DBI->connect( 'DBI:Mock:', '', '' )
-          || die "Cannot create handle: $DBI::errstr\n";
-        return $dbh;
-});
+my $context = t::lib::Mocks::mock_dbh;
 
 use_ok('Koha::SuggestionEngine');