1--TEST--
2SQLite3::open error test
3--SKIPIF--
4<?php
5if(substr(PHP_OS, 0, 3) == 'WIN' ) {
6	die('skip non windows test');
7}
8require_once(dirname(__FILE__) . '/skipif.inc');
9if (posix_geteuid() == 0) {
10    die('SKIP Cannot run test as root.');
11}
12?>
13--FILE--
14<?php
15$unreadable = dirname(__FILE__) . '/unreadable.db';
16touch($unreadable);
17chmod($unreadable,  0200);
18try {
19	$db = new SQLite3($unreadable);
20} catch (Exception $e) {
21	echo $e . "\n";
22}
23echo "Done\n";
24unlink($unreadable);
25?>
26--EXPECTF--
27exception 'Exception' with message 'Unable to open database: %s' in %ssqlite3_15_open_error.php:%d
28Stack trace:
29#0 %ssqlite3_15_open_error.php(%d): SQLite3->__construct('%s')
30#1 {main}
31Done
32