Bugzilla – Attachment 180572 Details for
Bug 39545
Construct more complete 773 content when creating a child record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39545: Unit tests
Bug-39545-Unit-tests.patch (text/plain), 4.18 KB, created by
Janusz Kaczmarek
on 2025-04-03 14:27:40 UTC
(
hide
)
Description:
Bug 39545: Unit tests
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2025-04-03 14:27:40 UTC
Size:
4.18 KB
patch
obsolete
>From 6c119143215c9a59894b683e054faf4219c488e8 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Thu, 3 Apr 2025 14:22:54 +0000 >Subject: [PATCH] Bug 39545: Unit tests > >--- > t/db_dependent/Biblio.t | 69 +++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 67 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t >index 79109d708a..4207c40305 100755 >--- a/t/db_dependent/Biblio.t >+++ b/t/db_dependent/Biblio.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 25; >+use Test::More tests => 26; > use Test::MockModule; > use Test::Warn; > use List::MoreUtils qw( uniq ); >@@ -37,7 +37,7 @@ use C4::Linker::Default qw( get_link ); > BEGIN { > use_ok( > 'C4::Biblio', >- qw( AddBiblio GetMarcFromKohaField BiblioAutoLink GetMarcSubfieldStructure GetMarcSubfieldStructureFromKohaField LinkBibHeadingsToAuthorities GetBiblioData ModBiblio GetMarcISSN GetMarcISBN GetMarcPrice GetFrameworkCode GetMarcUrls IsMarcStructureInternal GetMarcStructure GetXmlBiblio DelBiblio ) >+ qw( AddBiblio GetMarcFromKohaField BiblioAutoLink GetMarcSubfieldStructure GetMarcSubfieldStructureFromKohaField LinkBibHeadingsToAuthorities GetBiblioData ModBiblio GetMarcISSN GetMarcISBN GetMarcPrice GetFrameworkCode GetMarcUrls IsMarcStructureInternal GetMarcStructure GetXmlBiblio DelBiblio prepare_host_field ) > ); > } > >@@ -1378,6 +1378,71 @@ subtest 'AddBiblio/ModBiblio calling ModBiblioMarc for field 005' => sub { > ok( $field && $field->data, 'Record contains field 005 after ModBiblio' ); > }; > >+subtest 'Construction of field 773' => sub { >+ plan tests => 1; >+ >+ my $marc_record = MARC::Record->new; >+ $marc_record->leader(' cam a22 i 4500'); >+ $marc_record->insert_fields_ordered( MARC::Field->new( '001', 'e50010474705' ) ); >+ $marc_record->insert_fields_ordered( MARC::Field->new( '003', 'UkLCURL' ) ); >+ $marc_record->insert_fields_ordered( MARC::Field->new( '020', ' ', ' ', a => '0130810819' ) ); >+ $marc_record->insert_fields_ordered( MARC::Field->new( '020', ' ', ' ', a => '020163354x' ) ); >+ $marc_record->insert_fields_ordered( MARC::Field->new( '100', '1', ' ', a => 'Stevens, W. Richard' ) ); >+ $marc_record->insert_fields_ordered( >+ MARC::Field->new( >+ '245', '1', '0', >+ a => 'UNIX network programming.', >+ n => 'Vol. 2,', >+ p => 'Interprocess communications /', >+ c => 'by W. Richard Stevens.' >+ ) >+ ); >+ $marc_record->insert_fields_ordered( MARC::Field->new( '250', ' ', ' ', a => '2nd edition' ) ); >+ $marc_record->insert_fields_ordered( >+ MARC::Field->new( >+ '260', ' ', ' ', >+ a => 'Upper Saddle River, N.J. :', >+ b => 'Prentice Hall PTR,', >+ c => 'c1999.' >+ ) >+ ); >+ $marc_record->insert_fields_ordered( >+ MARC::Field->new( >+ '490', '1', ' ', >+ a => 'Addison-Wesley professional computing series' >+ ) >+ ); >+ $marc_record->insert_fields_ordered( >+ MARC::Field->new( >+ '830', ' ', '0', >+ a => 'Addison-Wesley professional computing series', >+ x => '1234-5678' >+ ) >+ ); >+ $marc_record->insert_fields_ordered( MARC::Field->new( '942', '0', ' ', c => 'BK' ) ); >+ >+ my $expected_field_773 = MARC::Field->new( >+ '773', '0', ' ', >+ 7 => 'p1am', >+ a => 'Stevens, W. Richard', >+ t => 'UNIX network programming. Vol. 2, Interprocess communications', >+ b => '2nd edition', >+ d => 'Upper Saddle River, N.J. : Prentice Hall PTR, c1999', >+ k => 'Addison-Wesley professional computing series, ISSN 1234-5678', >+ z => '020163354x', >+ z => '0130810819', >+ w => '(UkLCURL)e50010474705' >+ ); >+ my ( $biblionumber, undef ) = >+ AddBiblio( $marc_record, '', { skip_record_index => 1 } ); >+ my $host_field = prepare_host_field( $biblionumber, 'MARC21' ); >+ is( >+ $host_field->as_formatted, >+ $expected_field_773->as_formatted, >+ 'Host field 773 formed corrrectly' >+ ); >+}; >+ > # Cleanup > Koha::Caches->get_instance->clear_from_cache("MarcSubfieldStructure-"); > $schema->storage->txn_rollback; >-- >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 39545
:
180571
|
180572
|
180600
|
180601