Bugzilla – Attachment 152062 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 - Adding unit Test
Bug-29522---Adding-unit-Test.patch (text/plain), 1.77 KB, created by
Hammat wele
on 2023-06-06 17:43:40 UTC
(
hide
)
Description:
Bug 29522 - Adding unit Test
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2023-06-06 17:43:40 UTC
Size:
1.77 KB
patch
obsolete
>From ff0da796f4ae228ec76b052fad38fa8a511e98ea Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Tue, 6 Jun 2023 17:42:42 +0000 >Subject: [PATCH] Bug 29522 - Adding unit Test > >--- > t/AuthoritiesMarc_MARC21.t | 28 ++++++++++++++++++++++++++-- > 1 file changed, 26 insertions(+), 2 deletions(-) > >diff --git a/t/AuthoritiesMarc_MARC21.t b/t/AuthoritiesMarc_MARC21.t >index 4ed2e1dfb3..f640affbdd 100755 >--- a/t/AuthoritiesMarc_MARC21.t >+++ b/t/AuthoritiesMarc_MARC21.t >@@ -8,11 +8,11 @@ use warnings; > > use Test::MockModule; > use Test::MockObject; >-use Test::More tests => 5; >+use Test::More tests => 6; > use t::lib::Mocks; > use MARC::Record; > >-use C4::AuthoritiesMarc qw( FindDuplicateAuthority ); >+use C4::AuthoritiesMarc qw( FindDuplicateAuthority isAuthorityDuplicated ); > > BEGIN { > use_ok('C4::AuthoritiesMarc::MARC21', qw( default_auth_type_location fix_marc21_auth_type_location )); >@@ -60,3 +60,27 @@ subtest "FindDuplicateAuthority tests" => sub { > is( $query, q{at:"GENRE/FORM" AND he:"Potato"}, "Query formed correctly for Elasticsearch"); > > }; >+ >+subtest "isAuthorityDuplicated tests" => sub { >+ plan tests => 2; >+ my $record1 = MARC::Record->new; >+ $record1->append_fields( >+ MARC::Field->new('110', '', '', a => 'Potato' ), >+ ); >+ >+ my $record2 = MARC::Record->new; >+ $record2->append_fields( >+ MARC::Field->new('110', '', '', a => 'Potato' ), >+ ); >+ >+ my $duplicate = isAuthorityDuplicated( $record1, $record2, "CORPO_NAME" ); >+ is( $duplicate, 1 ); >+ >+ $record2->delete_fields($record2->field('110')); >+ $record2->append_fields( >+ MARC::Field->new('110', '', '', a => 'Newvalue' ), >+ ); >+ >+ $duplicate = isAuthorityDuplicated( $record1, $record2, "CORPO_NAME" ); >+ is( $duplicate, 0 ); >+}; >-- >2.34.1
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