diff options
Diffstat (limited to 'ext/sqlite3/tests/sqlite3_prepare_faultystmt.phpt')
-rw-r--r-- | ext/sqlite3/tests/sqlite3_prepare_faultystmt.phpt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/sqlite3/tests/sqlite3_prepare_faultystmt.phpt b/ext/sqlite3/tests/sqlite3_prepare_faultystmt.phpt new file mode 100644 index 0000000..5cdf322 --- /dev/null +++ b/ext/sqlite3/tests/sqlite3_prepare_faultystmt.phpt @@ -0,0 +1,20 @@ +--TEST-- +SQLite3::prepare test, testing for faulty statement +--CREDITS-- +Michelangelo van Dam +# Belgian PHP Testfest 2009 +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php +$db = new SQLite3(':memory:'); +$db->exec('CREATE TABLE foo (id INTEGER, bar STRING)'); +$db->exec("INSERT INTO foo (id, bar) VALUES (1, 'This is a test')"); + +$stmt = $db->prepare('SELECT foo FROM bar'); + +var_dump($stmt); +?> +--EXPECTF-- +Warning: SQLite3::prepare(): Unable to prepare statement: 1, no such table: bar in %s on line %d +bool(false) |