You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$error = "Query error: Unknown column 'asdsa' in 'WHERE' (1054).";
37
+
}
38
+
34
39
$expectedErrors = [
35
40
[
36
41
"Query error: 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 (1064).",
@@ -61,7 +66,7 @@ public function testSyntaxErrorInQueryRule(): void
61
66
107,
62
67
],
63
68
[
64
-
"Query error: Unknown column 'asdsa' in 'where clause' (1054).",
69
+
$error,
65
70
122,
66
71
],
67
72
[
@@ -165,6 +170,10 @@ public function testSyntaxErrorInQueryRule(): void
self::markTestSkipped("We don't test all variants of expectations for all drivers");
175
+
}
176
+
168
177
$expectedErrors = [
169
178
[
170
179
"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).",
Copy file name to clipboardExpand all lines: tests/rules/SyntaxErrorInQueryFunctionRuleTest.php
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ public function testSyntaxErrorInQueryRule(): void
39
39
publicfunctiongetExpectedErrors(): array
40
40
{
41
41
$dbaReflector = getenv('DBA_REFLECTOR');
42
+
$platform = $_ENV['DBA_PLATFORM'];
42
43
43
44
switch ($dbaReflector) {
44
45
case MysqliQueryReflector::NAME:
@@ -52,7 +53,9 @@ public function getExpectedErrors(): array
52
53
19,
53
54
],
54
55
[
55
-
"Query error: Unknown column 'asdsa' in 'where clause' (1054).",
56
+
$platform === 'mariadb' ?
57
+
"Query error: Unknown column 'asdsa' in 'WHERE' (1054)."
58
+
: "Query error: Unknown column 'asdsa' in 'where clause' (1054).",
56
59
39,
57
60
],
58
61
];
@@ -87,6 +90,10 @@ public function getExpectedErrors(): array
87
90
],
88
91
];
89
92
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
+
90
97
return [
91
98
[
92
99
"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).",
"Query error: 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 (1064).",
@@ -41,19 +57,19 @@ public function testSyntaxErrorInQueryRule(): void
41
57
16,
42
58
],
43
59
[
44
-
"Query error: Unknown column 'doesNotExist' in 'field list' (1054).",
60
+
$errSelect,
45
61
21,
46
62
],
47
63
[
48
-
"Query error: Unknown column 'doesNotExist' in 'where clause' (1054).",
64
+
$errWhere,
49
65
26,
50
66
],
51
67
[
52
-
"Query error: Unknown column 'doesNotExist' in 'order clause' (1054).",
68
+
$errOrder,
53
69
31,
54
70
],
55
71
[
56
-
"Query error: Unknown column 'doesNotExist' in 'group statement' (1054).",
72
+
$errGroup,
57
73
36,
58
74
],
59
75
[
@@ -73,11 +89,11 @@ public function testSyntaxErrorInQueryRule(): void
73
89
82,
74
90
],
75
91
[
76
-
"Query error: Unknown column 'asdsa' in 'where clause' (1054).",
92
+
$errWhere2,
77
93
103,
78
94
],
79
95
[
80
-
"Query error: Unknown column 'xy' in 'group statement' (1054).",
96
+
$errGroup2,
81
97
118,
82
98
],
83
99
[
@@ -98,6 +114,10 @@ public function testSyntaxErrorInQueryRule(): void
self::markTestSkipped("We don't test all variants of expectations for all drivers");
119
+
}
120
+
101
121
$expected = [
102
122
[
103
123
"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