Skip to content

Commit efff0ab

Browse files
authored
Use new constants (#411)
* Use new constants * Update SyntaxErrorInPreparedStatementMethodRuleReflectorTest.php
1 parent d33be6b commit efff0ab

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/rules/SyntaxErrorInPreparedStatementMethodRuleReflectorTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\RuleTestCase;
7+
use staabm\PHPStanDba\QueryReflection\MysqliQueryReflector;
8+
use staabm\PHPStanDba\QueryReflection\PdoMysqlQueryReflector;
9+
use staabm\PHPStanDba\QueryReflection\PdoPgSqlQueryReflector;
710
use staabm\PHPStanDba\Rules\SyntaxErrorInPreparedStatementMethodRule;
811

912
/**
@@ -29,7 +32,7 @@ public function testSyntaxErrorInQueryRule(): void
2932
self::markTestSkipped('Test requires PHP 7.4.');
3033
}
3134

32-
if ('mysqli' === getenv('DBA_REFLECTOR')) {
35+
if (MysqliQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
3336
$expectedErrors = [
3437
[
3538
"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).",
@@ -76,7 +79,7 @@ public function testSyntaxErrorInQueryRule(): void
7679
319,
7780
],
7881
];
79-
} elseif ('pdo-pgsql' === getenv('DBA_REFLECTOR')) {
82+
} elseif (PdoPgSqlQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
8083
$expectedErrors = [
8184
[
8285
'Query error: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "freigabe1u1"
@@ -145,7 +148,7 @@ public function testSyntaxErrorInQueryRule(): void
145148
319,
146149
],
147150
];
148-
} elseif ('pdo-mysql' === getenv('DBA_REFLECTOR')) {
151+
} elseif (PdoMysqlQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
149152
$expectedErrors = [
150153
[
151154
"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)