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