Files
php-src/ext/pdo_sqlite/tests/pdo_sqlite_open_basedir_uri.phpt
Ilija Tovilo 2b5aac9303 Fix unescaped {TMP} variables in tests
On Windows {TMP} can return ~, which will result in a parse error
2023-03-01 13:24:39 +01:00

33 lines
614 B
PHP

--TEST--
PDO_sqlite: Testing URIs with open_basedir
--EXTENSIONS--
pdo_sqlite
--INI--
open_basedir="{TMP}"
--FILE--
<?php
// create in basedir
$filename = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'pdo_sqlite_filename.db';
new PDO('sqlite:file:' . $filename);
?>
--CLEAN--
<?php
$filenames = [
sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'pdo_sqlite_filename.db',
];
foreach ($filenames as $filename) {
if (file_exists($filename)) {
unlink($filename);
}
}
?>
--EXPECTF--
Fatal error: Uncaught PDOException: open_basedir prohibits opening %s in %s:%d
Stack trace:
%s
#1 {main}
thrown in %s