@@ -, +, @@ --- t/db_dependent/Search.t | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) --- a/t/db_dependent/Search.t +++ a/t/db_dependent/Search.t @@ -31,6 +31,7 @@ use Test::More tests => 3; use Test::MockModule; use Test::Warn; use t::lib::Mocks; +use t::lib::TestBuilder; use Koha::Caches; @@ -45,6 +46,8 @@ use File::Path; our $child; our $datadir; +my $builder = t::lib::TestBuilder->new; + sub index_sample_records_and_launch_zebra { my ($datadir, $marc_type) = @_; @@ -700,15 +703,17 @@ ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' ## Regression test for Bug 10741 # make one of the test items appear to be in transit - my $circ_module = Test::MockModule->new('C4::Circulation'); - $circ_module->mock('GetTransfers', sub { - my $itemnumber = shift // -1; - if ($itemnumber == 11) { - return ('2013-07-19', 'MPL', 'CPL'); - } else { - return; + my $transfer = $builder->build( + { + source => 'Branchtransfer', + value => { + itemnumber => 11, + frombranch => 'MPL', + tobranch => 'CPL', + datesent => \'NOW()' + } } - }); + ); ($error, $results_hashref, $facets_loop) = getRecords("TEST12121212","TEST12121212",[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); @newresults = searchResults({'interface'=>'intranet'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0, --