Bug 12782: t/db_dependent/XISBN.t fails in DOM setup
[srvgit] / t / db_dependent / XISBN.t
index 55f25a1..1f6f797 100755 (executable)
@@ -10,6 +10,7 @@ use MARC::Record;
 use C4::Biblio;
 use C4::XISBN;
 use C4::Context;
+use C4::Search;
 use Test::MockModule;
 
 BEGIN {
@@ -35,8 +36,9 @@ my ( $isbn_tag, $isbn_subfield ) =
 my $isbn1 = '0590353403';
 # ThingISBN match : Silent Wing, First Edition 1998
 my $isbn2 = '0684843897';
-# XISBN match : Harry Potter and the Philosopher's Stone, Magic ed. 2000
-my $isbn3 = '1551923963';
+# XISBN match : Harry Potter and the Sorcerer's Stone,
+# 1. Scholastic mass market paperback printing1.
+my $isbn3 = '043936213X';
 
 my $biblionumber1 = _add_biblio_with_isbn($isbn1);
 my $biblionumber2 = _add_biblio_with_isbn($isbn2);
@@ -65,6 +67,8 @@ is( $results_xisbn->[0]->{biblionumber},
     $biblionumber3,
     "Gets correct biblionumber from a book with a similar isbn using XISBN." );
 
+$dbh->rollback;
+
 # Util subs
 
 # Add new biblio with isbn and return biblionumber
@@ -110,6 +114,10 @@ sub Mock_SimpleSearch {
     }
     $record->append_fields($biblionumber_field);
 
-    push @results, $record->as_usmarc;
+    my $indexing_mode = C4::Context->config('zebra_bib_index_mode') // 'dom';
+    push @results, ( $indexing_mode eq 'dom' )
+                    ? $record->as_xml()
+                    : $record->as_usmarc() ;
+
     return ( undef, \@results, 1 );
 }