Bugzilla – Attachment 21040 Details for
Bug 7933
Fields in marc display not the same
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7933: Unit test for C4::Biblio::RemoveHiddenSubfields
Bug-7933-Unit-test-for-C4BiblioRemoveHiddenSubfiel.patch (text/plain), 2.63 KB, created by
Kyle M Hall (khall)
on 2013-09-12 13:54:43 UTC
(
hide
)
Description:
Bug 7933: Unit test for C4::Biblio::RemoveHiddenSubfields
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-09-12 13:54:43 UTC
Size:
2.63 KB
patch
obsolete
>From 6418a4f0d7fe8ed6ad268091923404842aae2908 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Thu, 13 Jun 2013 10:12:08 +0200 >Subject: [PATCH] Bug 7933: Unit test for C4::Biblio::RemoveHiddenSubfields > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Run without errors. No koha-qa errors > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/Biblio/RemoveHiddenSubfields.t | 60 ++++++++++++++++++++++++++++++++++++++ > 1 files changed, 60 insertions(+), 0 deletions(-) > create mode 100755 t/Biblio/RemoveHiddenSubfields.t > >diff --git a/t/Biblio/RemoveHiddenSubfields.t b/t/Biblio/RemoveHiddenSubfields.t >new file mode 100755 >index 0000000..2261606 >--- /dev/null >+++ b/t/Biblio/RemoveHiddenSubfields.t >@@ -0,0 +1,60 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+use Test::More tests => 6; >+ >+use C4::Biblio; >+ >+# Avoid "redefined subroutine" warnings >+local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /redefined/ }; >+*C4::Biblio::GetMarcStructure = \&Mock_GetMarcStructure; >+ >+my $tagslib = { >+ '200' => { a => { hidden => '0' } }, >+ '300' => { a => { hidden => '1' } }, >+ '009' => { '@' => { hidden => '-2' } }, >+}; >+ >+my $record_ori = MARC::Record->new; >+$record_ori->append_fields( >+ MARC::Field->new( '200', '', '', 'a' => 'Text to show' ) ); >+$record_ori->append_fields( >+ MARC::Field->new( '300', '', '', 'a' => 'Text to hide OPAC' ) ); >+$record_ori->append_fields( >+ MARC::Field->new( '009', 'Text to hide Intranet' ) ); >+ >+my $record_opac = $record_ori->clone; >+RemoveHiddenSubfields( $record_opac, $tagslib, 'opac' ); >+is( $record_opac->subfield( '200', 'a' ), >+ 'Text to show', >+ 'RemoveHiddenSubfields for OPAC does not remove always visible subfields' ); >+is( $record_opac->subfield( '300', 'a' ), >+ undef, 'RemoveHiddenSubfields for OPAC removes OPAC hidden subfields' ); >+is( >+ $record_opac->field('009')->data, >+ 'Text to hide Intranet', >+ 'RemoveHiddenSubfields for OPAC does not remove Intranet hidden subfields' >+); >+ >+my $record_intra = $record_ori->clone; >+RemoveHiddenSubfields( $record_intra, $tagslib, 'intranet' ); >+is( >+ $record_intra->subfield( '200', 'a' ), >+ 'Text to show', >+'RemoveHiddenSubfields for Intranet does not remove always visible subfields' >+); >+is( >+ $record_intra->subfield( '300', 'a' ), >+ 'Text to hide OPAC', >+ 'RemoveHiddenSubfields for Intranet does not remove OPAC hidden subfields' >+); >+is( $record_intra->field('009'), >+ undef, >+ 'RemoveHiddenSubfields for Intranet removes Intranet hidden subfields' ); >+ >+# Mocked subs >+ >+# C4::Biblio::GetMarcStructure >+sub Mock_GetMarcStructure { >+ return $tagslib; >+} >-- >1.7.2.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 7933
:
9045
|
9046
|
9308
|
13707
|
16231
|
18913
|
18914
|
20880
|
20881
|
21018
|
21039
| 21040 |
21041