Bugzilla – Attachment 183176 Details for
Bug 40119
Merge should not leave empty 6XX subfield $2 (MARC 21)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40119: Unit tests
Bug-40119-Unit-tests.patch (text/plain), 2.94 KB, created by
Roman Dolny
on 2025-06-11 18:21:27 UTC
(
hide
)
Description:
Bug 40119: Unit tests
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2025-06-11 18:21:27 UTC
Size:
2.94 KB
patch
obsolete
>From 7a027e6eb656e036cde79dae113b2ddbb019601c Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Wed, 11 Jun 2025 14:18:59 +0000 >Subject: [PATCH] Bug 40119: Unit tests > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > t/db_dependent/Authority/Merge.t | 37 +++++++++++++++++++++++++++++++- > 1 file changed, 36 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Authority/Merge.t b/t/db_dependent/Authority/Merge.t >index 440fac5005..209a81a0ec 100755 >--- a/t/db_dependent/Authority/Merge.t >+++ b/t/db_dependent/Authority/Merge.t >@@ -668,7 +668,7 @@ subtest 'merge should not reorder too much' => sub { > }; > > subtest 'Test how merge handles controlled indicators' => sub { >- plan tests => 4; >+ plan tests => 8; > > # Note: See more detailed tests in t/Koha/Authority/ControlledIndicators.t > >@@ -711,6 +711,41 @@ subtest 'Test how merge handles controlled indicators' => sub { > ); > $biblio2 = Koha::Biblios->find($biblionumber)->metadata->record; > is( $biblio2->subfield( '609', '2' ), undef, 'No subfield $2 left' ); >+ isnt( $biblio2->subfield( '609', '2' ), '', 'Subfield $2 does not exist or exists and is not empty' ); >+ >+ # auth 040 / biblio 6XX $2 manipulation >+ # Case 1: auth 040 $f modification >+ my $auth_record = MARC::Record->new; >+ $auth_record->append_fields( MARC::Field->new( '008', ' ' x 11 . 'z' . ' ' x 28 ) ); >+ $auth_record->append_fields( MARC::Field->new( '040', ' ', ' ', a => 'OrgCode', f => 'special_thes' ) ); >+ $auth_record->append_fields( MARC::Field->new( '109', '0', ' ', a => 'Name' ) ); >+ my $authid = AddAuthority( $auth_record, undef, $authtype1 ); >+ my $biblio_record = MARC::Record->new; >+ $biblio_record->append_fields( >+ MARC::Field->new( '609', '0', '7', a => 'Name', 2 => 'other_special', 9 => $authid ) ); >+ ($biblionumber) = AddBiblio( $biblio_record, '' ); >+ merge( >+ { >+ mergefrom => $authid, MARCfrom => $auth_record, mergeto => $authid, MARCto => $auth_record, >+ biblionumbers => [$biblionumber], >+ } >+ ); >+ $biblio_record = Koha::Biblios->find($biblionumber)->metadata->record; >+ is( $biblio_record->subfield( '609', '2' ), 'special_thes', 'Thesaurus correctly updated' ); >+ >+ # Case 2: auth 040 $f removal >+ $auth_record->field('040')->delete_subfield( code => 'f' ); >+ ModAuthority( $authid, $auth_record, $authtype1 ); >+ merge( >+ { >+ mergefrom => $authid, MARCfrom => $auth_record, mergeto => $authid, MARCto => $auth_record, >+ biblionumbers => [$biblionumber], >+ } >+ ); >+ $biblio_record = Koha::Biblios->find($biblionumber)->metadata->record; >+ isnt( $biblio_record->subfield( '609', '2' ), '', 'Subfield $2 does not exist or exists and is not empty' ); >+ is( $biblio_record->subfield( '609', '2' ), 'special_thes', 'Subfield $2 contains didn\'t change' ); >+ > }; > > subtest "Test bibs not auto linked when merging" => sub { >-- >2.39.5
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 40119
:
183165
|
183166
|
183175
|
183176
|
183192
|
183193
|
183194