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