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/bug73959.phpt
2025-08-26 09:06:19 +02:00

29 lines
742 B
PHP

--TEST--
Bug #73959 (lastInsertId fails to throw an exception)
--EXTENSIONS--
pdo_pgsql
--SKIPIF--
<?php
require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
require __DIR__ . '/config.inc';
PDOTest::skip();
?>
--FILE--
<?php
require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
require __DIR__ . '/config.inc';
$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
$db->setAttribute(PDO::ATTR_PERSISTENT, false);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->setAttribute(Pdo\Pgsql::ATTR_DISABLE_PREPARES, true);
try {
$db->lastInsertId('nonexistent_seq');
echo "Error: No exception thrown";
} catch (PDOException $e) {
echo "Success: Exception thrown";
}
?>
--EXPECT--
Success: Exception thrown