Bugzilla – Attachment 163188 Details for
Bug 29522
Bib record not correctly updated when merging identical authorities with LinkerModule set to First Match
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29522: Unit test
Bug-29522-Unit-test.patch (text/plain), 2.47 KB, created by
Marcel de Rooy
on 2024-03-15 10:23:15 UTC
(
hide
)
Description:
Bug 29522: Unit test
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-03-15 10:23:15 UTC
Size:
2.47 KB
patch
obsolete
>From 66da4a353fa238c314dca1c015ec970b108e6511 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 26 Jan 2024 13:15:12 +0000 >Subject: [PATCH] Bug 29522: Unit test >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Authority/Merge.t | 40 +++++++++++++++++++++++++++++++- > 1 file changed, 39 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Authority/Merge.t b/t/db_dependent/Authority/Merge.t >index 0720ab329b..0fd332ab4d 100755 >--- a/t/db_dependent/Authority/Merge.t >+++ b/t/db_dependent/Authority/Merge.t >@@ -4,11 +4,12 @@ > > use Modern::Perl; > >-use Test::More tests => 11; >+use Test::More tests => 12; > > use Getopt::Long; > use MARC::Record; > use Test::MockModule; >+use Test::Warn; > > use t::lib::Mocks; > use t::lib::TestBuilder; >@@ -516,6 +517,43 @@ subtest 'Test how merge handles controlled indicators' => sub { > is( $biblio2->subfield('609', '2'), undef, 'No subfield $2 left' ); > }; > >+subtest "Test bibs not auto linked when merging" => sub { >+ plan tests => 1; >+ >+ my $authmarc = MARC::Record->new; >+ $authmarc->append_fields( MARC::Field->new( '109', '', '', 'a' => 'aa', b => 'bb' ) ); >+ my $oldauthmarc = MARC::Record->new; >+ $oldauthmarc->append_fields( MARC::Field->new( '112', '', '', c => 'cc' ) ); >+ my $new_id = AddAuthority( $authmarc, undef, $authtype1 ); >+ my $old_id = AddAuthority( $oldauthmarc, undef, $authtype1 ); >+ my $biblio = MARC::Record->new; >+ $biblio->append_fields( >+ MARC::Field->new( '109', '', '', a => 'a1', 9 => $old_id ), >+ MARC::Field->new( '612', '', '', a => 'a2', c => 'cc', 9 => $old_id ), >+ ); >+ my ($biblionumber) = C4::Biblio::AddBiblio( $biblio, '' ); >+ >+ my $biblio_module = Test::MockModule->new('C4::AuthoritiesMarc'); >+ $biblio_module->mock( >+ 'ModBiblio', >+ sub { >+ my ( undef, undef, undef, $params ) = @_; >+ warn "Auto link disabled" if $params->{disable_autolink}; >+ } >+ ); >+ >+ warnings_are { >+ merge( >+ { >+ mergefrom => $old_id, MARCfrom => $oldauthmarc, mergeto => $new_id, MARCto => $authmarc, >+ biblionumbers => [$biblionumber] >+ } >+ ); >+ } >+ ["Auto link disabled"], "Auto link disabled when merging authorities"; >+ >+}; >+ > sub set_mocks { > # After we removed the Zebra code from merge, we only need to mock > # get_usage_count and linked_biblionumbers here. >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29522
:
152061
|
152062
|
155278
|
159837
|
161525
|
161526
|
163187
| 163188