Bugzilla – Attachment 20244 Details for
Bug 7683
statistic wizard: cataloging
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7683: Add unit tests for GetMarcSubfieldStructureFromKohaField
Bug-7683-Add-unit-tests-for-GetMarcSubfieldStructu.patch (text/plain), 1.89 KB, created by
Owen Leonard
on 2013-08-09 17:05:19 UTC
(
hide
)
Description:
Bug 7683: Add unit tests for GetMarcSubfieldStructureFromKohaField
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-08-09 17:05:19 UTC
Size:
1.89 KB
patch
obsolete
>From 7346b44bec34f2ba0e6c79017c9e5ace1b466f67 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 19 Mar 2013 11:00:57 +0000 >Subject: [PATCH] Bug 7683: Add unit tests for > GetMarcSubfieldStructureFromKohaField >Content-Type: text/plain; charset="utf-8" > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > t/Biblio_GetMarcSubfieldStructureFromKohaField.t | 30 ++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > create mode 100755 t/Biblio_GetMarcSubfieldStructureFromKohaField.t > >diff --git a/t/Biblio_GetMarcSubfieldStructureFromKohaField.t b/t/Biblio_GetMarcSubfieldStructureFromKohaField.t >new file mode 100755 >index 0000000..106147f >--- /dev/null >+++ b/t/Biblio_GetMarcSubfieldStructureFromKohaField.t >@@ -0,0 +1,30 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+use Test::More tests => 24; >+use Data::Dumper; >+ >+BEGIN { >+ use_ok('C4::Biblio'); >+} >+ >+my @columns = qw( >+ tagfield tagsubfield liblibrarian libopac repeatable mandatory kohafield tab >+ authorised_value authtypecode value_builder isurl hidden frameworkcode >+ seealso link defaultvalue maxlength >+); >+ >+# biblio.biblionumber must be mapped so this should return something >+my $marc_subfield_structure = GetMarcSubfieldStructureFromKohaField('biblio.biblionumber', ''); >+ >+ok(defined $marc_subfield_structure, "There is a result"); >+is(ref $marc_subfield_structure, "HASH", "Result is a hashref"); >+foreach my $col (@columns) { >+ ok(exists $marc_subfield_structure->{$col}, "Hashref contains key '$col'"); >+} >+is($marc_subfield_structure->{kohafield}, 'biblio.biblionumber', "Result is the good result"); >+like($marc_subfield_structure->{tagfield}, qr/^\d{3}$/, "tagfield is a valid tagfield"); >+ >+# foo.bar does not exist so this should return undef >+$marc_subfield_structure = GetMarcSubfieldStructureFromKohaField('foo.bar', ''); >+is($marc_subfield_structure, undef, "invalid kohafield returns undef"); >-- >1.7.9.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 7683
:
12762
|
12785
|
12940
|
14399
|
14466
|
16327
|
16328
|
16329
|
16367
|
16775
|
20241
|
20242
|
20243
|
20244
|
20245
|
21357
|
21358
|
23683
|
23684
|
23685
|
23686
|
23687
|
23688
|
23689
|
23690
|
23691
|
25072
|
25073
|
25091
|
25092
|
25093
|
25094
|
25095
|
25096
|
25097
|
25098
|
25099
|
25100
|
26678
|
26679
|
26680
|
26681
|
26682
|
28466
|
28467
|
28468
|
28469
|
28470
|
36489
|
36490
|
36491
|
36492
|
36493
|
39129
|
39130
|
39131
|
39132
|
39133
|
41821
|
41829
|
44651
|
44652
|
44653
|
44654
|
44655
|
45238
|
45239
|
45240
|
45241
|
45242