Annotation of embedaddon/php/ext/sqlite3/tests/sqlite3_32_last_insert_rowid_param.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SQLite3::lastInsertRowID parameter test
! 3: --CREDITS--
! 4: Jelle Lampaert
! 5: #Belgian Testfest 2009
! 6: --SKIPIF--
! 7: <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
! 8: --FILE--
! 9: <?php
! 10:
! 11: $db = new SQLite3(':memory:');
! 12:
! 13: echo "Creating Table\n";
! 14: var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)'));
! 15:
! 16: echo "Inserting data\n";
! 17: var_dump($db->exec('INSERT INTO test (time, id) VALUES(2, 1)'));
! 18:
! 19: echo "Request last inserted id\n";
! 20: try {
! 21: $db->lastInsertRowID("");
! 22: } catch (Exception $ex) {
! 23: var_dump($ex->getMessage());
! 24: }
! 25:
! 26: echo "Closing database\n";
! 27: var_dump($db->close());
! 28: echo "Done";
! 29: ?>
! 30: --EXPECTF--
! 31: Creating Table
! 32: bool(true)
! 33: Inserting data
! 34: bool(true)
! 35: Request last inserted id
! 36:
! 37: Warning: SQLite3::lastInsertRowID() expects exactly 0 parameters, %d given in %s on line %d
! 38: Closing database
! 39: bool(true)
! 40: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>