Annotation of embedaddon/php/ext/sqlite3/tests/sqlite3_prepared_stmt_clear_with_params.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SQLite3Stmt::clear test with parameters
! 3: --CREDITS--
! 4: Thijs Feryn <thijs@feryn.eu>
! 5: #TestFest PHPBelgium 2009
! 6: --SKIPIF--
! 7: <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
! 8: --FILE--
! 9: <?php
! 10: $db = new SQLite3(':memory:');
! 11: define('TIMENOW', time());
! 12: echo "Creating Table\n";
! 13: $db->exec('CREATE TABLE test (time INTEGER, id STRING)');
! 14: echo "INSERT into table\n";
! 15: var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')"));
! 16:
! 17: echo "SELECTING results\n";
! 18: $stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC");
! 19: var_dump($stmt->clear('invalid argument'));
! 20: echo "Closing database\n";
! 21: var_dump($db->close());
! 22: echo "Done\n";
! 23: ?>
! 24: --EXPECTF--
! 25: Creating Table
! 26: INSERT into table
! 27: bool(true)
! 28: SELECTING results
! 29:
! 30: Warning: SQLite3Stmt::clear() expects exactly 0 parameters, 1 given in %s on line %d
! 31: NULL
! 32: Closing database
! 33: bool(true)
! 34: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>