From d77a65fe7a3a8f0fb3d7fac2419abb3cc3563d1f Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 25 Feb 2020 15:09:53 +0000 Subject: [PATCH] Bug 24052: Catch warning between test 5 and 6 Resolve: ok 5 - Engine returns error on undefined text XSLT::Base: Empty String at /usr/share/koha/Koha/XSLT/Base.pm line 214. ok 6 - Engine returns error on empty string Test plan: Run perl Base.t and verify that this warning is no longer printed. Signed-off-by: Marcel de Rooy Signed-off-by: Owen Leonard Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize --- t/db_dependent/Koha/XSLT/Base.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Koha/XSLT/Base.t b/t/db_dependent/Koha/XSLT/Base.t index cf4bf2ff14..55f490c6e8 100644 --- a/t/db_dependent/Koha/XSLT/Base.t +++ b/t/db_dependent/Koha/XSLT/Base.t @@ -20,7 +20,7 @@ use Modern::Perl; use File::Temp qw/tempfile/; -use Test::More tests => 32; +use Test::More tests => 33; use Test::Warn; use Koha::XSLT::Base; @@ -70,7 +70,9 @@ $output = $engine->transform({ xml => undef, code => $xsl_1 }); is( $engine->err, Koha::XSLT::Base::XSLTH_ERR_7, 'Engine returns error on undefined text' ); # Empty string tests -$output = $engine->transform({ xml => '', code => $xsl_1 }); +warning_like {$output = $engine->transform({ xml => '', code => $xsl_1 }) } + qr/XSLT::Base: Empty String/, + 'Empty string warning detected'; is( $engine->err, Koha::XSLT::Base::XSLTH_ERR_5, 'Engine returns error on empty string' ); # Non-XML tests -- 2.39.5