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 835-846
subtest 'autoControlNumber tests' => sub {
Link Here
|
835 |
is($record->field('001'), undef, '001 not set when pref is off'); |
836 |
is($record->field('001'), undef, '001 not set when pref is off'); |
836 |
|
837 |
|
837 |
t::lib::Mocks::mock_preference('autoControlNumber', 'biblionumber'); |
838 |
t::lib::Mocks::mock_preference('autoControlNumber', 'biblionumber'); |
838 |
C4::Biblio::ModBiblio($record, $biblionumber, "", 1); |
839 |
C4::Biblio::ModBiblio($record, $biblionumber, "", { skip_record_index => 1, disable_autolink => 1 }); |
839 |
$record = GetMarcBiblio({biblionumber => $biblionumber}); |
840 |
$record = GetMarcBiblio({biblionumber => $biblionumber}); |
840 |
is($record->field('001')->as_string(), $biblionumber, '001 set to biblionumber when pref set and field is blank'); |
841 |
is($record->field('001')->as_string(), $biblionumber, '001 set to biblionumber when pref set and field is blank'); |
841 |
|
842 |
|
842 |
$record->field('001')->update('Not biblionumber'); |
843 |
$record->field('001')->update('Not biblionumber'); |
843 |
C4::Biblio::ModBiblio($record, $biblionumber, "", 1); |
844 |
C4::Biblio::ModBiblio($record, $biblionumber, "", { skip_record_index => 1, disable_autolink => 1 }); |
844 |
$record = GetMarcBiblio({biblionumber => $biblionumber}); |
845 |
$record = GetMarcBiblio({biblionumber => $biblionumber}); |
845 |
is($record->field('001')->as_string(), 'Not biblionumber', '001 not set to biblionumber when pref set and field exists'); |
846 |
is($record->field('001')->as_string(), 'Not biblionumber', '001 not set to biblionumber when pref set and field exists'); |
846 |
|
847 |
|
847 |
- |
|
|