Skip to content

Commit 3bb6011

Browse files
committed
fix
1 parent 90d59c3 commit 3bb6011

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

tests/rules/QueryPlanAnalyzerRuleTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ public static function getAdditionalConfigFiles(): array
5757

5858
public function testNotUsingIndex(): void
5959
{
60+
if ('pdo-pgsql' === getenv('DBA_REFLECTOR')) {
61+
self::markTestSkipped('query plan analyzer is not yet implemented for pgsql');
62+
}
63+
64+
if (ReflectorFactory::MODE_RECORDING !== getenv('DBA_MODE')) {
65+
self::markTestSkipped('query plan analyzer requires a active database connection');
66+
}
67+
6068
$this->numberOfAllowedUnindexedReads = true;
6169
$this->numberOfRowsNotRequiringIndex = 2;
6270

@@ -104,6 +112,14 @@ public function testNotUsingIndex(): void
104112

105113
public function testNotUsingIndexInDebugMode(): void
106114
{
115+
if ('pdo-pgsql' === getenv('DBA_REFLECTOR')) {
116+
self::markTestSkipped('query plan analyzer is not yet implemented for pgsql');
117+
}
118+
119+
if (ReflectorFactory::MODE_RECORDING !== getenv('DBA_MODE')) {
120+
self::markTestSkipped('query plan analyzer requires a active database connection');
121+
}
122+
107123
$this->debugMode = true;
108124
$this->numberOfAllowedUnindexedReads = true;
109125
$this->numberOfRowsNotRequiringIndex = 2;

tests/rules/SyntaxErrorInQueryMethodRuleTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ public function testSyntaxErrorInQueryRule(): void
119119
],
120120
[
121121
"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).",
122-
155,
122+
154,
123123
],
124124
[
125125
"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).",
126-
156,
126+
155,
127127
],
128128
];
129129
} elseif (PdoMysqlQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
@@ -198,11 +198,11 @@ public function testSyntaxErrorInQueryRule(): void
198198
],
199199
[
200200
"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).",
201-
155,
201+
154,
202202
],
203203
[
204204
"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).",
205-
156,
205+
155,
206206
],
207207
];
208208
} elseif (PdoPgSqlQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
@@ -319,13 +319,13 @@ public function testSyntaxErrorInQueryRule(): void
319319
'Query error: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "freigabe1u1"
320320
LINE 1: SELECT email adaid WHERE gesperrt freigabe1u1 FROM ada LIMIT...
321321
^ (42601).',
322-
155,
322+
154,
323323
],
324324
[
325325
'Query error: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "freigabe1u1"
326326
LINE 1: SELECT email adaid WHERE gesperrt freigabe1u1 FROM ada LIMIT...
327327
^ (42601).',
328-
156,
328+
155,
329329
],
330330
];
331331
} else {

0 commit comments

Comments
 (0)