[Koha-patches] [PATCH] bug_11213: Include XSLT processing for searchResults() test
Srdjan
srdjan at catalyst.net.nz
Fri Apr 1 01:47:19 CEST 2016
* 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 874deee..9a6a38f 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 c61c583..6ac0fab 100644
--- a/t/db_dependent/Search.t
+++ b/t/db_dependent/Search.t
@@ -123,6 +123,8 @@ $contextmodule->mock('preference', sub {
return 'en';
} 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');
--
2.5.0
More information about the Koha-patches
mailing list