Bugzilla – Attachment 119414 Details for
Bug 27774
Always remove hyphens from ISBN when cataloging
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27774: Add unit test
Bug-27774-Add-unit-test.patch (text/plain), 2.35 KB, created by
Kyle M Hall (khall)
on 2021-04-09 16:10:24 UTC
(
hide
)
Description:
Bug 27774: Add unit test
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-04-09 16:10:24 UTC
Size:
2.35 KB
patch
obsolete
>From 6647789c053aef028838138084153ff2be4214a8 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 9 Apr 2021 12:09:47 -0400 >Subject: [PATCH] Bug 27774: Add unit test > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Biblio/TransformMarcToKoha.t | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Biblio/TransformMarcToKoha.t b/t/db_dependent/Biblio/TransformMarcToKoha.t >index 60d7a95833..e2280e7024 100755 >--- a/t/db_dependent/Biblio/TransformMarcToKoha.t >+++ b/t/db_dependent/Biblio/TransformMarcToKoha.t >@@ -42,20 +42,22 @@ Koha::MarcSubfieldStructure->new({ frameworkcode => '', tagfield => '500', tagsu > Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" ); > > subtest 'Test a few mappings' => sub { >- plan tests => 7; >+ plan tests => 8; > > my $marc = MARC::Record->new; > $marc->append_fields( >+ MARC::Field->new( '020', '', '', a => '978-0441-172719' ), > MARC::Field->new( '300', '', '', a => 'a1', b => 'b1' ), > MARC::Field->new( '300', '', '', a => 'a2', b => 'b2' ), > MARC::Field->new( '500', '', '', a => 'note1', a => 'note2' ), > ); > my $result = C4::Biblio::TransformMarcToKoha( $marc ); > # Note: TransformMarcToKoha stripped the table prefix biblio. >- is( keys %{$result}, 3, 'Found all three mappings' ); >+ is( keys %{$result}, 4, 'Found all three mappings' ); > is( $result->{field1}, 'a1 | a2', 'Check field1 results' ); > is( $result->{field2}, 'b1 | b2', 'Check field2 results' ); > is( $result->{field3}, 'note1 | note2', 'Check field3 results' ); >+ is( $result->{isbn}, '9780441172719', 'ISBN hypens have been removed' ); > > is( C4::Biblio::TransformMarcToKohaOneField( 'biblio.field1', $marc ), > $result->{field1}, 'TransformMarcToKohaOneField returns biblio.field1'); >@@ -67,7 +69,7 @@ subtest 'Test a few mappings' => sub { > # CAUTION: This parameter of TransformMarcToKoha will be removed later > my $new_fw = t::lib::TestBuilder->new->build({source => 'BiblioFramework'}); > $result = C4::Biblio::TransformMarcToKoha($marc, $new_fw->{frameworkcode}); >- is( keys %{$result}, 3, 'Still found all three mappings' ); >+ is( keys %{$result}, 4, 'Still found all three mappings' ); > }; > > subtest 'Multiple mappings for one kohafield' => sub { >-- >2.24.3 (Apple Git-128)
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 27774
:
117277
|
117329
|
119413
|
119414
|
119452