Skip to content

Commit 7abaa7f

Browse files
authored
Use new constants (#412)
* Use new constants * Update SyntaxErrorInQueryMethodRuleTest.php
1 parent efff0ab commit 7abaa7f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/rules/SyntaxErrorInQueryMethodRuleTest.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\SyntaxErrorInQueryMethodRule;
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
$expected = [
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).",
@@ -80,7 +83,7 @@ public function testSyntaxErrorInQueryRule(): void
8083
118,
8184
],
8285
];
83-
} elseif ('pdo-mysql' === getenv('DBA_REFLECTOR')) {
86+
} elseif (PdoMysqlQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
8487
$expected = [
8588
[
8689
"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).",
@@ -131,7 +134,7 @@ public function testSyntaxErrorInQueryRule(): void
131134
118,
132135
],
133136
];
134-
} elseif ('pdo-pgsql' === getenv('DBA_REFLECTOR')) {
137+
} elseif (PdoPgSqlQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
135138
$expected = [
136139
[
137140
'Query error: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "freigabe1u1"

0 commit comments

Comments
 (0)