Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
use File::Temp qw/tempfile/; |
21 |
use File::Temp qw/tempfile/; |
22 |
use Test::More tests => 7; |
22 |
use Test::More tests => 8; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
|
24 |
|
25 |
use Koha::XSLT::Base; |
25 |
use Koha::XSLT::Base; |
Lines 120-128
$xslt=<<"EOT";
Link Here
|
120 |
EOT |
120 |
EOT |
121 |
$xslt_file = mytempfile($xslt); |
121 |
$xslt_file = mytempfile($xslt); |
122 |
$engine->print_warns(1); |
122 |
$engine->print_warns(1); |
123 |
warning_like { $output= $engine->transform( "<ignored/>", $xslt_file ); } |
123 |
{ |
124 |
qr/I\/O warning : failed to load external entity/, |
124 |
my @warn; |
125 |
'Remote import does not fail on read_net'; |
125 |
local $SIG{__WARN__} = sub { push @warn, $_[0]; }; |
|
|
126 |
$output= $engine->transform( "<ignored/>", $xslt_file ); |
127 |
is( ( grep { /failed to load external/ } @warn ), 1, 'Expected import error' ); |
128 |
is( ( grep { /read_net/ } @warn ), 0, 'No read_net warn for remote import' ); |
129 |
} |
126 |
|
130 |
|
127 |
sub mytempfile { |
131 |
sub mytempfile { |
128 |
my ( $fh, $fn ) = tempfile( SUFFIX => '.xsl', UNLINK => 1 ); |
132 |
my ( $fh, $fn ) = tempfile( SUFFIX => '.xsl', UNLINK => 1 ); |
129 |
- |
|
|