From 0d387c8572fed0126e01b344af6c044a7102313e 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 850525a..e6a4fb9 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -25,6 +25,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 cadfedb..ca07048 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -125,6 +125,8 @@ $contextmodule->mock('preference', sub { return ''; } elsif ($pref eq 'AlternateHoldingsField') { return '490av'; + } elsif ($pref =~ m/XSLTResultsDisplay/) { + return 'default'; } elsif ($pref eq 'AuthoritySeparator') { return '--'; } elsif ($pref eq 'DisplayLibraryFacets') { @@ -191,6 +193,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.9.1