Bugzilla – Attachment 31865 Details for
Bug 12973
Allow passing code to XSLT_Handler instead of filename
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12973: Additional unit tests for XSLT_Handler.t
Bug-12973-Additional-unit-tests-for-XSLTHandlert.patch (text/plain), 1.99 KB, created by
Marcel de Rooy
on 2014-09-25 09:37:41 UTC
(
hide
)
Description:
Bug 12973: Additional unit tests for XSLT_Handler.t
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2014-09-25 09:37:41 UTC
Size:
1.99 KB
patch
obsolete
>From 7689b5f6ef1d4d89d2c3a83afd99ffee8b3a2f69 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 25 Sep 2014 11:22:40 +0200 >Subject: [PATCH] Bug 12973: Additional unit tests for XSLT_Handler.t >Content-Type: text/plain; charset=utf-8 > >The additional way of parameter passing is tested in three additional >tests. > >Test plan: >Verify if XSLT_Handler.t passes. >--- > t/db_dependent/XSLT_Handler.t | 15 +++++++++++++-- > 1 files changed, 13 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/XSLT_Handler.t b/t/db_dependent/XSLT_Handler.t >index 8bdfdef..770568c 100644 >--- a/t/db_dependent/XSLT_Handler.t >+++ b/t/db_dependent/XSLT_Handler.t >@@ -20,7 +20,8 @@ > use Modern::Perl; > > use FindBin; >-use Test::More tests => 24; >+use File::Slurp; >+use Test::More tests => 27; > > use Koha::XSLT_Handler; > >@@ -96,6 +97,16 @@ $output= $engine->transform( $xml_2 ); > #note: second parameter (file) not passed again > is( $engine->err, undef, 'Engine returned no error for xml_2' ); > is( index($output,'I saw you')>0, 1, 'Saw the expected change for xml_2' ); #Just very simple check if new datafield was added >+#Test alternative parameter passing >+my $output2; >+$output2 = $engine->transform( { file => $xsltfile_1, xml => $xml_2 } ); >+is( $output, $output2, 'Try hash parameter file'); >+my $code = read_file( $xsltfile_1 ); >+$output2 = $engine->transform( { code => $code, xml => $xml_2 } ); >+is( $output, $output2, 'Try hash parameter code'); >+#Check rerun on last code >+$output2 = $engine->transform( $xml_2 ); >+is( $output, $output2, 'Rerun on previous passed code'); > > #The second test xsl contains bad code > my $xsltfile_2 = 'test02.xsl'; >@@ -114,6 +125,6 @@ exit if !-e $path.$xsltfile_3; > $xsltfile_3= $path.$xsltfile_3; > $output= $engine->transform( $xml_2, $xsltfile_3 ); > is( $engine->err, undef, 'Unexpected error on transform with third xsl' ); >-is( $engine->refresh, 2, 'Final test on clearing cache' ); >+is( $engine->refresh, 3, 'Final test on clearing cache' ); > > #End of tests >-- >1.7.7.6
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12973
:
31864
|
31865
|
33553
|
33554
|
34352
|
34353
|
34354
|
35345