Lines 70-75
subtest 'AddBiblio' => sub {
Link Here
|
70 |
|
70 |
|
71 |
t::lib::Mocks::mock_preference( 'BiblioAddsAuthorities', $marcflavour ); |
71 |
t::lib::Mocks::mock_preference( 'BiblioAddsAuthorities', $marcflavour ); |
72 |
t::lib::Mocks::mock_preference( 'AutoCreateAuthorities', $marcflavour ); |
72 |
t::lib::Mocks::mock_preference( 'AutoCreateAuthorities', $marcflavour ); |
|
|
73 |
t::lib::Mocks::mock_preference( 'autoControlNumber', "OFF" ); |
73 |
|
74 |
|
74 |
my $mock_biblio = Test::MockModule->new("C4::Biblio"); |
75 |
my $mock_biblio = Test::MockModule->new("C4::Biblio"); |
75 |
$mock_biblio->mock( BiblioAutoLink => sub { |
76 |
$mock_biblio->mock( BiblioAutoLink => sub { |
Lines 834-845
subtest 'autoControlNumber tests' => sub {
Link Here
|
834 |
is($record->field('001'), undef, '001 not set when pref is off'); |
835 |
is($record->field('001'), undef, '001 not set when pref is off'); |
835 |
|
836 |
|
836 |
t::lib::Mocks::mock_preference('autoControlNumber', 'biblionumber'); |
837 |
t::lib::Mocks::mock_preference('autoControlNumber', 'biblionumber'); |
837 |
C4::Biblio::ModBiblio($record, $biblionumber, "", 1); |
838 |
C4::Biblio::ModBiblio($record, $biblionumber, "", { skip_record_index => 1, disable_autolink => 1 }); |
838 |
$record = GetMarcBiblio({biblionumber => $biblionumber}); |
839 |
$record = GetMarcBiblio({biblionumber => $biblionumber}); |
839 |
is($record->field('001')->as_string(), $biblionumber, '001 set to biblionumber when pref set and field is blank'); |
840 |
is($record->field('001')->as_string(), $biblionumber, '001 set to biblionumber when pref set and field is blank'); |
840 |
|
841 |
|
841 |
$record->field('001')->update('Not biblionumber'); |
842 |
$record->field('001')->update('Not biblionumber'); |
842 |
C4::Biblio::ModBiblio($record, $biblionumber, "", 1); |
843 |
C4::Biblio::ModBiblio($record, $biblionumber, "", { skip_record_index => 1, disable_autolink => 1 }); |
843 |
$record = GetMarcBiblio({biblionumber => $biblionumber}); |
844 |
$record = GetMarcBiblio({biblionumber => $biblionumber}); |
844 |
is($record->field('001')->as_string(), 'Not biblionumber', '001 not set to biblionumber when pref set and field exists'); |
845 |
is($record->field('001')->as_string(), 'Not biblionumber', '001 not set to biblionumber when pref set and field exists'); |
845 |
|
846 |
|
846 |
- |
|
|