From d66c5ebdfeb8c0a041550d526562c785333aeb4b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 27 Aug 2014 10:11:28 -0300 Subject: [PATCH] [SIGNED-OFF] Bug 11672: (followup) warnings tested Content-Type: text/plain; charset="utf-8" Signed-off-by: Owen Leonard --- t/db_dependent/Reports_Guided.t | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/t/db_dependent/Reports_Guided.t b/t/db_dependent/Reports_Guided.t index 4e2041a5..9c4a93d 100755 --- a/t/db_dependent/Reports_Guided.t +++ b/t/db_dependent/Reports_Guided.t @@ -17,7 +17,8 @@ use Modern::Perl; -use Test::More tests => 16; +use Test::More tests => 17; +use Test::Warn; use C4::Context; @@ -100,11 +101,11 @@ is_deeply( # for next test, we want to let execute_query capture any SQL errors $dbh->{RaiseError} = 0; my $errors; -($sth, $errors) = execute_query( - 'SELECT surname FRM borrowers', # error in the query is intentional - 0, - 10, -); +warning_like { ($sth, $errors) = execute_query( + 'SELECT surname FRM borrowers', # error in the query is intentional + 0, 10 ) } + qr/^DBD::mysql::st execute failed: You have an error in your SQL syntax;/, + "Wrong SQL syntax raises warning"; ok( defined($errors) && exists($errors->{queryerr}), 'attempting to run a report with an SQL syntax error returns error message (Bug 12214)' -- 1.7.9.5