1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00
Files
archived-php-src/ext/pdo_sqlite/tests/pdo_sqlite_lastinsertid.phpt
Ilija Tovilo 660996662a Switch sqlite tests from "" to '' and re-enable for FreeBSD
FreeBSD builds without DQS (double-quote support). Transform tests so we can
re-eanble them for FreeBSD. Add separate tests for DQS.

Closes GH-21495
2026-04-02 22:15:08 +02:00

30 lines
641 B
PHP

--TEST--
PDO_sqlite: Testing lastInsertId()
--EXTENSIONS--
pdo_sqlite
--FILE--
<?php
$db = new PDO('sqlite::memory:');
$db->query('CREATE TABLE test_pdo_sqlite_lastinsertid (id INT AUTO INCREMENT, name TEXT)');
$db->query("INSERT INTO test_pdo_sqlite_lastinsertid VALUES (NULL, 'PHP'), (NULL, 'PHP6')");
var_dump($db->query('SELECT * FROM test_pdo_sqlite_lastinsertid'));
var_dump($db->errorInfo());
var_dump($db->lastInsertId());
?>
--EXPECT--
object(PDOStatement)#2 (1) {
["queryString"]=>
string(42) "SELECT * FROM test_pdo_sqlite_lastinsertid"
}
array(3) {
[0]=>
string(5) "00000"
[1]=>
NULL
[2]=>
NULL
}
string(1) "2"