Bug 24756: Catch two failed to load-variations in Security.t

Test 7 in Security.t failed when 'failed to load HTTP resource' was
returned by libxml2 instead of 'failed to load external entity'.

We now remove the debugging with Dumper again and adjust the regex to
include both variations.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Marcel de Rooy 2020-03-02 11:08:18 +00:00 committed by Martin Renvoize
parent bd9960a2d2
commit 292f562605
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -18,7 +18,6 @@
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use Data::Dumper qw/Dumper/;
use File::Temp qw/tempfile/;
use Test::More tests => 8;
use Test::Warn;
@ -118,7 +117,7 @@ $engine->print_warns(1);
my @warn;
local $SIG{__WARN__} = sub { push @warn, $_[0]; };
$output= $engine->transform({ xml => "<ignored/>", code => $xslt });
is( ( grep { /failed to load external/ } @warn ), 1, 'Expected import error. Additional info: '.Dumper(@warn) );
is( ( grep { /failed to load (external entity|HTTP resource)/ } @warn ), 1, 'Expected import error' ); # we saw both messages on Jenkins passing by
is( ( grep { /read_net/ } @warn ), 0, 'No read_net warn for remote import' );
}