From 58c505553ea3df7c252ccc9e5b88480a1d4c2fd6 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 19 Nov 2014 18:05:54 -0300 Subject: [PATCH] Bug 13278: (QA followup) use t::lib::Mocks Signed-off-by: Tomas Cohen Arazi --- t/Search.t | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/t/Search.t b/t/Search.t index 69ed79f..5618ead 100755 --- a/t/Search.t +++ b/t/Search.t @@ -18,16 +18,10 @@ use Modern::Perl; use Test::More tests => 3; -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('C4::Search'); can_ok('C4::Search', -- 1.9.1