Skip to content

Commit cc55129

Browse files
staabmclxmstaab
andauthored
added multi line query test (#86)
Co-authored-by: Markus Staab <[email protected]>
1 parent d027eed commit cc55129

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

.phpunit-phpstan-dba.cache

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
'schemaVersion' => 'v3-rename-props',
33
'records' =>
44
array (
5+
'
6+
SELECT email, adaid
7+
FROM ada
8+
WHERE gesperrt = 1 AND email LIKE \'%@example%\'
9+
LIMIT 1
10+
' =>
11+
array (
12+
'error' => NULL,
13+
),
514
'SELECT * FROM ada GROUP BY doesNotExist' =>
615
array (
716
'error' =>

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"php-cs-fixer fix"
3333
],
3434
"phpstan-dba-baseline": [
35+
"phpunit",
3536
"phpstan analyse -c phpstan.neon.dist --debug"
3637
],
3738
"phpstan": [

tests/data/syntax-error-in-prepared-statement.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ public function syntaxError(Connection $connection)
1414
public function preparedParams(Connection $connection)
1515
{
1616
$connection->preparedQuery('SELECT email, adaid FROM ada WHERE gesperrt = ?', [1]);
17+
18+
$connection->preparedQuery('
19+
SELECT email, adaid
20+
FROM ada
21+
WHERE gesperrt = ? AND email LIKE ?
22+
LIMIT 1
23+
', [1, '%@example%']);
1724
}
1825

1926
public function preparedNamedParams(Connection $connection)

0 commit comments

Comments
 (0)