Annotation of embedaddon/php/ext/sqlite3/tests/sqlite3stmt_reset_params.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SQLite3Stmt::reset with 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: $db = new SQLite3(':memory:');
! 11: echo "Creating Table\n";
! 12: var_dump($db->exec('CREATE TABLE foobar (id INTEGER, name STRING)'));
! 13:
! 14: echo "INSERT into table\n";
! 15: var_dump($db->exec("INSERT INTO foobar (id, name) VALUES (1, 'john')"));
! 16:
! 17:
! 18: $query = "SELECT name FROM foobar WHERE id = 1";
! 19:
! 20: echo "Prepare query\n";
! 21: $stmt = $db->prepare($query);
! 22:
! 23: echo "Reset query\n";
! 24: try {
! 25: $stmt->reset("foo");
! 26: } catch (Exception $ex) {
! 27: var_dump($ex->getMessage());
! 28: }
! 29:
! 30: echo "Closing database\n";
! 31: $stmt = null;
! 32: $result = null;
! 33: var_dump($db->close());
! 34: echo "Done\n";
! 35: ?>
! 36: --EXPECTF--
! 37: Creating Table
! 38: bool(true)
! 39: INSERT into table
! 40: bool(true)
! 41: Prepare query
! 42: Reset query
! 43:
! 44: Warning: SQLite3Stmt::reset() expects exactly 0 parameters, %d given in %s on line %d
! 45: Closing database
! 46: bool(true)
! 47: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>