1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/pdo_pgsql/tests/pdopgsql_003.phpt
Ilija Tovilo 8f21763616 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix varying pgsql error message
2025-02-26 21:30:32 +01:00

32 lines
696 B
PHP

--TEST--
Pdo\Pgsql getWarningCount
--EXTENSIONS--
pdo_pgsql
--SKIPIF--
<?php
require __DIR__ . '/config.inc';
require dirname(__DIR__, 2) . '/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
require_once __DIR__ . "/config.inc";
$db = Pdo::connect($config['ENV']['PDOTEST_DSN']);
if (!$db instanceof Pdo\Pgsql) {
echo "Wrong class type. Should be Pdo\Pgsql but is " . get_class($db) . "\n";
}
echo $db->escapeIdentifier("This is a quote\"") . "\n";
try {
$db->escapeIdentifier("aa\xC3\xC3\xC3");
} catch (PDOException $e) {
echo $e->getMessage() . "\n";
}
--EXPECTF--
"This is a quote"""
SQLSTATE[HY000]: General error: 7 %r(incomplete|invalid)%r multibyte character