Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 16; |
20 |
use Test::More tests => 17; |
|
|
21 |
use Test::Warn; |
21 |
|
22 |
|
22 |
use C4::Context; |
23 |
use C4::Context; |
23 |
|
24 |
|
Lines 100-110
is_deeply(
Link Here
|
100 |
# for next test, we want to let execute_query capture any SQL errors |
101 |
# for next test, we want to let execute_query capture any SQL errors |
101 |
$dbh->{RaiseError} = 0; |
102 |
$dbh->{RaiseError} = 0; |
102 |
my $errors; |
103 |
my $errors; |
103 |
($sth, $errors) = execute_query( |
104 |
warning_like { ($sth, $errors) = execute_query( |
104 |
'SELECT surname FRM borrowers', # error in the query is intentional |
105 |
'SELECT surname FRM borrowers', # error in the query is intentional |
105 |
0, |
106 |
0, 10 ) } |
106 |
10, |
107 |
qr/^DBD::mysql::st execute failed: You have an error in your SQL syntax;/, |
107 |
); |
108 |
"Wrong SQL syntax raises warning"; |
108 |
ok( |
109 |
ok( |
109 |
defined($errors) && exists($errors->{queryerr}), |
110 |
defined($errors) && exists($errors->{queryerr}), |
110 |
'attempting to run a report with an SQL syntax error returns error message (Bug 12214)' |
111 |
'attempting to run a report with an SQL syntax error returns error message (Bug 12214)' |
111 |
- |
|
|