bug 7284: fix package build problem, move BEGIN into new
authorMJ Ray <mjr@phonecoop.coop>
Thu, 29 Mar 2012 17:35:04 +0000 (18:35 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Wed, 4 Apr 2012 16:18:12 +0000 (18:18 +0200)
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
C4/Heading/UNIMARC.pm
t/Heading_MARC21.t [deleted file]
t/db_dependent/Heading_MARC21.t [new file with mode: 0755]

index 78536b8..7925345 100644 (file)
@@ -59,7 +59,17 @@ my %subdivisions = (
 
 my $bib_heading_fields;
 
-BEGIN {
+=head1 METHODS
+
+=head2 new
+
+  my $marc_handler = C4::Heading::UNIMARC->new();
+
+=cut
+
+sub new {
+    my $class = shift;
+
     my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare(
         "SELECT tagfield, authtypecode
@@ -74,18 +84,7 @@ BEGIN {
             subfields => 'abcdefghjklmnopqrstvxyz',
         };
     }
-}
-
-=head1 METHODS
 
-=head2 new
-
-  my $marc_handler = C4::Heading::UNIMARC->new();
-
-=cut
-
-sub new {
-    my $class = shift;
     return bless {}, $class;
 }
 
diff --git a/t/Heading_MARC21.t b/t/Heading_MARC21.t
deleted file mode 100755 (executable)
index 198eaea..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 3;
-
-BEGIN {
-        use_ok('C4::Heading');
-}
-
-my $field = MARC::Field->new( '650', ' ', '0', a => 'Uncles', x => 'Fiction' );
-my $heading = C4::Heading->new_from_bib_field($field);
-is($heading->display_form(), 'Uncles--Fiction', 'Display form generation');
-is($heading->search_form(), 'Uncles generalsubdiv Fiction', 'Search form generation');
diff --git a/t/db_dependent/Heading_MARC21.t b/t/db_dependent/Heading_MARC21.t
new file mode 100755 (executable)
index 0000000..198eaea
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 3;
+
+BEGIN {
+        use_ok('C4::Heading');
+}
+
+my $field = MARC::Field->new( '650', ' ', '0', a => 'Uncles', x => 'Fiction' );
+my $heading = C4::Heading->new_from_bib_field($field);
+is($heading->display_form(), 'Uncles--Fiction', 'Display form generation');
+is($heading->search_form(), 'Uncles generalsubdiv Fiction', 'Search form generation');