From 5f25de4e1a7f058341370a3df1e63e7708e0a37a Mon Sep 17 00:00:00 2001 From: Srdjan Date: Tue, 1 Apr 2014 19:15:46 +1300 Subject: [PATCH] bug_11213: Added XSLTParse4Display() to Items test --- t/db_dependent/Items.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t index 6cfb862..ce5342e 100755 --- a/t/db_dependent/Items.t +++ b/t/db_dependent/Items.t @@ -21,6 +21,7 @@ use Modern::Perl; use MARC::Record; use C4::Biblio; use C4::Branch; +use C4::XSLT; use Koha::Database; use Test::More tests => 6; @@ -35,7 +36,7 @@ my ($branch1, $branch2) = keys %$branches; subtest 'General Add, Get and Del tests' => sub { - plan tests => 8; + plan tests => 10; # Start transaction $dbh->{AutoCommit} = 0; @@ -55,6 +56,16 @@ subtest 'General Add, Get and Del tests' => sub { cmp_ok(scalar(@items_infos), '==', 1, "One item for biblionumber."); cmp_ok($items_infos[0]{biblionumber}, '==', $bibnum, "Item has correct biblionumber."); + C4::Context->set_preference('XSLTResultsDisplay', 'default'); + C4::Context->set_preference('OPACXSLTResultsDisplay', 'default'); + C4::Context->clear_syspref_cache(); + my $record = GetMarcBiblio($bibnum); + my $html = XSLTParse4Display($bibnum, $record, "OPACXSLTResultsDisplay", \@items_infos); + ok($html, "XSLTParse4Display( OPACXSLTResultsDisplay )"); + $html = XSLTParse4Display($bibnum, $record, "XSLTResultsDisplay", \@items_infos); + ok($html, "XSLTParse4Display( XSLTResultsDisplay )"); + + # Get item. my $getitem = GetItem($itemnumber); cmp_ok($getitem->{'itemnumber'}, '==', $itemnumber, "Retrieved item has correct itemnumber."); -- 1.9.1