From 93d1fc9c6903b71eeadc5379332cb78dc42ca74e Mon Sep 17 00:00:00 2001 From: Srdjan Date: Mon, 31 Mar 2014 16:12:17 +1300 Subject: [PATCH] bug_11213: Include XSLT processing for searchResults() test * Added template paths to temp test dir, so XSLT templates can be picked up --- C4/XSLT.pm | 1 + t/db_dependent/Search.t | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 0fde9dc..28b42b2 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -24,6 +24,7 @@ use strict; use warnings; use C4::Context; +use C4::Templates; use C4::Branch; use C4::Items; use C4::Koha; diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 9265594..5f86fdb 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -113,6 +113,8 @@ $contextmodule->mock('preference', sub { return ''; } elsif ($pref eq 'AlternateHoldingsField') { return '490av'; + } elsif ($pref =~ m/XSLTResultsDisplay/) { + return 'default'; } elsif ($pref eq 'authoritysep') { return '--'; } else { @@ -177,6 +179,15 @@ sub mock_marcfromkohafield { sub run_marc21_search_tests { my $indexing_mode = shift; $datadir = tempdir(); + # Unix friendly, but so is the zebra_config.pl command below... + my $tpl_dir = File::Spec->rel2abs( dirname(__FILE__) ) . "/../../koha-tmpl"; + my $opac_dir = "$datadir/opac"; + mkdir $opac_dir; + symlink "$tpl_dir/opac-tmpl", "$opac_dir/templates"; + my $intranet_dir = "$datadir/intranet"; + mkdir $intranet_dir; + symlink "$tpl_dir/intranet-tmpl", "$intranet_dir/templates"; + system(dirname(__FILE__) . "/zebra_config.pl $datadir marc21 $indexing_mode"); mock_marcfromkohafield('marc21'); -- 1.8.3.2