Skip to content

Commit d2ade4c

Browse files
committed
fix
1 parent 8f9f7fd commit d2ade4c

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

tests/rules/SyntaxErrorInPreparedStatementMethodRuleTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testSyntaxErrorInQueryRule(): void
3232
{
3333
if (MysqliQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
3434
$error = "Query error: Unknown column 'asdsa' in 'where clause' (1054).";
35-
if ('mariadb' === getenv('DBA_PLATFORM')) {
35+
if ('mariadb' === $_ENV['DBA_PLATFORM']) {
3636
$error = "Query error: Unknown column 'asdsa' in 'WHERE' (1054).";
3737
}
3838

@@ -170,6 +170,10 @@ public function testSyntaxErrorInQueryRule(): void
170170
],
171171
];
172172
} elseif (PdoMysqlQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
173+
if ('mariadb' === $_ENV['DBA_PLATFORM']) {
174+
self::markTestSkipped("We don't test all variants of expectations for all drivers");
175+
}
176+
173177
$expectedErrors = [
174178
[
175179
"Query error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL/MariaDB server version for the right syntax to use near 'freigabe1u1 FROM ada LIMIT 0' at line 1 (42000).",
@@ -261,7 +265,7 @@ public function testBug94()
261265
public function testSyntaxErrorWithInferencePlaceholder()
262266
{
263267
if (MysqliQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
264-
$platform = getenv('DBA_PLATFORM');
268+
$platform = $_ENV['DBA_PLATFORM'];
265269

266270
$error = "Query error: Unknown column 'does_not_exist' in 'field list' (1054).";
267271
if ($platform === "mariadb") {
@@ -304,6 +308,10 @@ public function testSyntaxErrorWithInferencePlaceholder()
304308
],
305309
];
306310
} elseif (PdoMysqlQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
311+
if ('mariadb' === $_ENV['DBA_PLATFORM']) {
312+
self::markTestSkipped("We don't test all variants of expectations for all drivers");
313+
}
314+
307315
$expectedErrors = [
308316
[
309317
"Query error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'does_not_exist' in 'field list' (42S22).",

tests/rules/SyntaxErrorInQueryFunctionRuleTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testSyntaxErrorInQueryRule(): void
3939
public function getExpectedErrors(): array
4040
{
4141
$dbaReflector = getenv('DBA_REFLECTOR');
42-
$platform = getenv('DBA_PLATFORM');
42+
$platform = $_ENV['DBA_PLATFORM'];
4343

4444
switch ($dbaReflector) {
4545
case MysqliQueryReflector::NAME:
@@ -90,6 +90,10 @@ public function getExpectedErrors(): array
9090
],
9191
];
9292
case PdoMysqlQueryReflector::NAME:
93+
if ('mariadb' === $_ENV['DBA_PLATFORM']) {
94+
self::markTestSkipped("We don't test all variants of expectations for all drivers");
95+
}
96+
9397
return [
9498
[
9599
"Query error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL/MariaDB server version for the right syntax to use near 'freigabe1u1 FROM ada LIMIT 0' at line 1 (42000).",

tests/rules/SyntaxErrorInQueryMethodRuleTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ public function testSyntaxErrorInQueryRule(): void
3535
$errWhere = "Query error: Unknown column 'doesNotExist' in 'where clause' (1054).";
3636
$errOrder = "Query error: Unknown column 'doesNotExist' in 'order clause' (1054).";
3737
$errGroup = "Query error: Unknown column 'doesNotExist' in 'group statement' (1054).";
38-
$errWhere2 = "Query error: Unknown column 'asdsa' in 'WHERE' (1054).";
39-
$errGroup2 = "Query error: Unknown column 'xy' in 'GROUP BY' (1054).";
38+
$errWhere2 = "Query error: Unknown column 'asdsa' in 'where clause' (1054).";
39+
$errGroup2 = "Query error: Unknown column 'xy' in 'group statement' (1054).";
4040

41-
if ('mariadb' === getenv('DBA_PLATFORM')) {
41+
if ('mariadb' === $_ENV['DBA_PLATFORM']) {
4242
$errSelect = "Query error: Unknown column 'doesNotExist' in 'SELECT' (1054).";
4343
$errWhere = "Query error: Unknown column 'doesNotExist' in 'WHERE' (1054).";
4444
$errOrder = "Query error: Unknown column 'doesNotExist' in 'ORDER BY' (1054).";
4545
$errGroup = "Query error: Unknown column 'doesNotExist' in 'GROUP BY' (1054).";
46-
$errWhere2 = "Unknown column 'asdsa' in 'WHERE' (1054).";
47-
$errGroup2 = "Unknown column 'xy' in 'GROUP BY' (1054).";
46+
$errWhere2 = "Query error: Unknown column 'asdsa' in 'WHERE' (1054).";
47+
$errGroup2 = "Query error: Unknown column 'xy' in 'GROUP BY' (1054).";
4848
}
4949

5050
$expected = [
@@ -114,6 +114,10 @@ public function testSyntaxErrorInQueryRule(): void
114114
],
115115
];
116116
} elseif (PdoMysqlQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
117+
if ('mariadb' === $_ENV['DBA_PLATFORM']) {
118+
self::markTestSkipped("We don't test all variants of expectations for all drivers");
119+
}
120+
117121
$expected = [
118122
[
119123
"Query error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL/MariaDB server version for the right syntax to use near 'freigabe1u1 FROM ada LIMIT 0' at line 1 (42000).",

0 commit comments

Comments
 (0)