Bugzilla – Attachment 181979 Details for
Bug 37364
Improve creation of 773 fields for item bundles regarding MARC21 245 and 264
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37364: Unit tests
Bug-37364-Unit-tests.patch (text/plain), 3.28 KB, created by
Martin Renvoize (ashimema)
on 2025-05-06 14:13:16 UTC
(
hide
)
Description:
Bug 37364: Unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-05-06 14:13:16 UTC
Size:
3.28 KB
patch
obsolete
>From 5554a572cb25d52fb66a8ee180e0fe1c14914b36 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 17 Jul 2024 09:57:53 +0100 >Subject: [PATCH] Bug 37364: Unit tests > >--- > t/db_dependent/Koha/Biblio.t | 30 +++++++++++++++++++++++++++--- > 1 file changed, 27 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 0cd7491d152..febb50d7737 100755 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -999,7 +999,7 @@ subtest 'get_volumes_query' => sub { > }; > > subtest 'generate_marc_host_field' => sub { >- plan tests => 22; >+ plan tests => 24; > > $schema->storage->txn_begin; > >@@ -1011,7 +1011,7 @@ subtest 'generate_marc_host_field' => sub { > MARC::Field->new( '001', '1234' ), > MARC::Field->new( '003', 'FIRST' ), > MARC::Field->new( '240', '', '', a => 'A uniform title' ), >- MARC::Field->new( '260', '', '', a => 'Publication' ), >+ MARC::Field->new( '260', '', '', a => 'Publication 260' ), > MARC::Field->new( '250', '', '', a => 'Edition a', b => 'Edition b' ), > MARC::Field->new( '022', '', '', a => '0317-8471' ), > ); >@@ -1025,7 +1025,7 @@ subtest 'generate_marc_host_field' => sub { > is( $link->tag, '773', "MARC::Field->tag returns '773' when marcflavour is 'MARC21" ); > is( $link->subfield('a'), 'Some boring author', 'MARC::Field->subfield(a) returns content from 100ab' ); > is( $link->subfield('b'), 'Edition a Edition b', 'MARC::Field->subfield(b) returns content from 250ab' ); >- is( $link->subfield('d'), 'Publication', 'MARC::Field->subfield(c) returns content from 260abc' ); >+ is( $link->subfield('d'), 'Publication 260', 'MARC::Field->subfield(c) returns content from 260abc' ); > is( $link->subfield('s'), 'A uniform title', 'MARC::Field->subfield(s) returns content from 240a' ); > is( $link->subfield('t'), 'Some boring read', 'MARC::Field->subfield(s) returns content from 245ab' ); > is( $link->subfield('x'), '0317-8471', 'MARC::Field->subfield(s) returns content from 022a' ); >@@ -1039,6 +1039,30 @@ subtest 'generate_marc_host_field' => sub { > 'MARC::Field->subfield(w) returns content from 003 and 001 when "UseControlNumber" is enabled' > ); > >+ $record->append_fields( >+ MARC::Field->new( '264', '', '', a => 'Publication 264' ), >+ ); >+ C4::Biblio::ModBiblio( $record, $biblio->biblionumber ); >+ $biblio = Koha::Biblios->find( $biblio->biblionumber ); >+ >+ $link = $biblio->generate_marc_host_field(); >+ is( >+ $link->subfield('d'), 'Publication 264', >+ 'MARC::Field->subfield(d) returns content from 264 in prefernce to 260' >+ ); >+ >+ $record->append_fields( >+ MARC::Field->new( '264', '3', '', a => 'Publication 264', b => 'Preferred' ), >+ ); >+ C4::Biblio::ModBiblio( $record, $biblio->biblionumber ); >+ $biblio = Koha::Biblios->find( $biblio->biblionumber ); >+ >+ $link = $biblio->generate_marc_host_field(); >+ is( >+ $link->subfield('d'), 'Publication 264 Preferred', >+ 'MARC::Field->subfield(d) returns content from 264 with indicator 1 = 3 in prefernce to 264 without' >+ ); >+ > # UNIMARC tests > t::lib::Mocks::mock_preference( 'marcflavour', 'UNIMARC' ); > >-- >2.49.0
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 37364
:
169075
|
169076
|
169077
|
181978
|
181979
|
182393
|
182394
|
182398
|
182399