Bug 12672: (regression test) GetMarcISBN should return the corresponding subfield
authorTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 29 Jul 2014 16:36:03 +0000 (13:36 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Sun, 3 Aug 2014 15:24:07 +0000 (12:24 -0300)
Run:
 $ prove -v t/db_dependent/Biblio.t
=> FAIL: GetMarcISBN doesn't return the expected value for ISBN
         in MARC21, NORMARC and UNIMARC

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Test fails, no koha-qa errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
t/db_dependent/Biblio.t

index 3c0a159..ca6c678 100755 (executable)
@@ -17,7 +17,7 @@
 
 use Modern::Perl;
 
-use Test::More tests => 3;
+use Test::More tests => 4;
 use Test::MockModule;
 
 use MARC::Record;
@@ -187,7 +187,8 @@ sub mock_marcfromkohafield {
         sub {
             my ( $self ) = shift;
 
-            if ( C4::Context->preference('marcflavour') eq 'MARC21' ) {
+            if ( C4::Context->preference('marcflavour') eq 'MARC21' ||
+                 C4::Context->preference('marcflavour') eq 'NORMARC' ) {
 
                 return  {
                 '' => {
@@ -227,6 +228,9 @@ sub create_isbn_field {
 
     my $isbn_field = ( $marcflavour eq 'UNIMARC' ) ? '010' : '020';
     my $field = MARC::Field->new( $isbn_field,'','','a' => $isbn);
+    # Add the price subfield
+    my $price_subfield = ( $marcflavour eq 'UNIMARC' ) ? 'd' : 'c' ;
+    $field->add_subfields( $price_subfield => '100' );
 
     return $field;
 }
@@ -252,5 +256,11 @@ subtest 'UNIMARC' => sub {
     $dbh->rollback;
 };
 
+subtest 'NORMARC' => sub {
+    plan tests => 25;
+    run_tests('NORMARC');
+    $dbh->rollback;
+};
+
 
 1;