Download src/php/php-src/ext/pdo_pgsql/tests/bug73959.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 742 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_pgsql/tests/bug73959.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pdo_pgsql/tests/bug73959.phpt
-
curl -L -o bug73959.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_pgsql/tests/bug73959.phpt
742 Bytes
| --TEST-- | |
| Bug #73959 (lastInsertId fails to throw an exception) | |
| --EXTENSIONS-- | |
| pdo_pgsql | |
| --SKIPIF-- | |
| require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; | |
| require __DIR__ . '/config.inc'; | |
| PDOTest::skip(); | |
| --FILE-- | |
| 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 | |