1--TEST--
2SQLite3::enableExceptions test
3--CREDITS--
4Thijs Feryn <thijs@feryn.eu>
5#TestFest PHPBelgium 2009
6--EXTENSIONS--
7sqlite3
8--FILE--
9<?php
10
11$db = new SQLite3(':memory:');
12var_dump($db->enableExceptions(true));
13try{
14    $db->query("SELECT * FROM non_existent_table");
15} catch(Exception $e) {
16    echo $e->getMessage().PHP_EOL;
17}
18var_dump($db->enableExceptions(false));
19$db->query("SELECT * FROM non_existent_table");
20echo "Closing database\n";
21var_dump($db->close());
22echo "Done\n";
23?>
24--EXPECTF--
25bool(false)
26no such table: non_existent_table
27
28Deprecated: SQLite3::enableExceptions(): Use of warnings for SQLite3 is deprecated in %s
29bool(true)
30
31Warning: SQLite3::query(): no such table: non_existent_table in %s on line %d
32Closing database
33bool(true)
34Done
35