Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
use staabm\PHPStanDba\QueryReflection\MysqliQueryReflector;
use staabm\PHPStanDba\QueryReflection\PdoMysqlQueryReflector;
use staabm\PHPStanDba\QueryReflection\PdoPgSqlQueryReflector;
use staabm\PHPStanDba\Rules\SyntaxErrorInPreparedStatementMethodRule;

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

if ('mysqli' === getenv('DBA_REFLECTOR')) {
if (MysqliQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
$expectedErrors = [
[
"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).",
Expand Down Expand Up @@ -76,7 +79,7 @@ public function testSyntaxErrorInQueryRule(): void
319,
],
];
} elseif ('pdo-pgsql' === getenv('DBA_REFLECTOR')) {
} elseif (PdoPgSqlQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
$expectedErrors = [
[
'Query error: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "freigabe1u1"
Expand Down Expand Up @@ -145,7 +148,7 @@ public function testSyntaxErrorInQueryRule(): void
319,
],
];
} elseif ('pdo-mysql' === getenv('DBA_REFLECTOR')) {
} elseif (PdoMysqlQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
$expectedErrors = [
[
"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).",
Expand Down