Bugzilla – Attachment 28467 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 [Follow-up] Move unit tests in t/db_dependent/Biblio.t
Bug-7683-Follow-up-Move-unit-tests-in-tdbdependent.patch (text/plain), 3.42 KB, created by
Julian Maurice
on 2014-05-23 12:26:31 UTC
(
hide
)
Description:
Bug 7683 [Follow-up] Move unit tests in t/db_dependent/Biblio.t
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2014-05-23 12:26:31 UTC
Size:
3.42 KB
patch
obsolete
>From 8e6aefbf91b6e9449886a9db8a5f545c087f7cfc Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 22 Mar 2013 12:05:54 +0000 >Subject: [PATCH] Bug 7683 [Follow-up] Move unit tests in > t/db_dependent/Biblio.t > >--- > t/Biblio_GetMarcSubfieldStructureFromKohaField.t | 30 ---------------------- > t/db_dependent/Biblio.t | 26 ++++++++++++++++++- > 2 files changed, 25 insertions(+), 31 deletions(-) > delete mode 100755 t/Biblio_GetMarcSubfieldStructureFromKohaField.t > >diff --git a/t/Biblio_GetMarcSubfieldStructureFromKohaField.t b/t/Biblio_GetMarcSubfieldStructureFromKohaField.t >deleted file mode 100755 >index 106147f..0000000 >--- a/t/Biblio_GetMarcSubfieldStructureFromKohaField.t >+++ /dev/null >@@ -1,30 +0,0 @@ >-#!/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"); >diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t >index 3c0a159..f4b490d 100755 >--- a/t/db_dependent/Biblio.t >+++ b/t/db_dependent/Biblio.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More tests => 4; > use Test::MockModule; > > use MARC::Record; >@@ -252,5 +252,29 @@ subtest 'UNIMARC' => sub { > $dbh->rollback; > }; > >+subtest 'GetMarcSubfieldStructureFromKohaField' => sub { >+ plan tests => 23; >+ >+ 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; >-- >1.7.10.4
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