From df31e73a0c234c4e7d118fa468158cfe1b0cad64 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 13 Jun 2022 12:22:37 +0000 Subject: [PATCH] Bug 27981: (follow-up) Fix tests --- t/db_dependent/Biblio.t | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t index 1c0a662d28..d824ed861b 100755 --- a/t/db_dependent/Biblio.t +++ b/t/db_dependent/Biblio.t @@ -70,6 +70,7 @@ subtest 'AddBiblio' => sub { t::lib::Mocks::mock_preference( 'BiblioAddsAuthorities', $marcflavour ); t::lib::Mocks::mock_preference( 'AutoCreateAuthorities', $marcflavour ); + t::lib::Mocks::mock_preference( 'autoControlNumber', "OFF" ); my $mock_biblio = Test::MockModule->new("C4::Biblio"); $mock_biblio->mock( BiblioAutoLink => sub { @@ -834,12 +835,12 @@ subtest 'autoControlNumber tests' => sub { is($record->field('001'), undef, '001 not set when pref is off'); t::lib::Mocks::mock_preference('autoControlNumber', 'biblionumber'); - C4::Biblio::ModBiblio($record, $biblionumber, "", 1); + C4::Biblio::ModBiblio($record, $biblionumber, "", { skip_record_index => 1, disable_autolink => 1 }); $record = GetMarcBiblio({biblionumber => $biblionumber}); is($record->field('001')->as_string(), $biblionumber, '001 set to biblionumber when pref set and field is blank'); $record->field('001')->update('Not biblionumber'); - C4::Biblio::ModBiblio($record, $biblionumber, "", 1); + C4::Biblio::ModBiblio($record, $biblionumber, "", { skip_record_index => 1, disable_autolink => 1 }); $record = GetMarcBiblio({biblionumber => $biblionumber}); is($record->field('001')->as_string(), 'Not biblionumber', '001 not set to biblionumber when pref set and field exists'); -- 2.30.2