Annotation of embedaddon/php/ext/sqlite3/tests/sqlite3stmt_paramCount_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SQLite3Stmt::paramCount error test
! 3: --SKIPIF--
! 4: <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: require_once(dirname(__FILE__) . '/new_db.inc');
! 9:
! 10: echo "Creating Table\n";
! 11: var_dump($db->exec('CREATE TABLE foobar (id INTEGER, name STRING, city STRING)'));
! 12:
! 13: echo "INSERT into table\n";
! 14: var_dump($db->exec("INSERT INTO foobar (id, name, city) VALUES (1, 'john', 'LA')"));
! 15: var_dump($db->exec("INSERT INTO foobar (id, name, city) VALUES (2, 'doe', 'SF')"));
! 16:
! 17:
! 18: $query = "SELECT * FROM foobar WHERE id = ? ORDER BY id ASC";
! 19:
! 20: echo "SELECTING results\n";
! 21:
! 22: $stmt = $db->prepare($query);
! 23:
! 24: echo "paramCount with wrong number of arguments\n";
! 25: var_dump($stmt->paramCount('foobar'));
! 26: $result = $stmt->execute();
! 27: echo "Closing database\n";
! 28: $stmt = null;
! 29: $result = null;
! 30: var_dump($db->close());
! 31: echo "Done\n";
! 32: ?>
! 33: --EXPECTF--
! 34: Creating Table
! 35: bool(true)
! 36: INSERT into table
! 37: bool(true)
! 38: bool(true)
! 39: SELECTING results
! 40: paramCount with wrong number of arguments
! 41:
! 42: Warning: SQLite3Stmt::paramCount() expects exactly 0 parameters, 1 given in %s on line %d
! 43: NULL
! 44: Closing database
! 45: bool(true)
! 46: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>