php-src/ext/pdo_sqlite/tests/open_basedir.phpt
Nikita Popov 7485978339
Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00

31 lines
732 B
PHP

--TEST--
PDO SQLite open_basedir check
--EXTENSIONS--
pdo_sqlite
--INI--
open_basedir=.
--FILE--
<?php
chdir(__DIR__);
try {
$db = new PDO('sqlite:../not_in_open_basedir.sqlite');
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
try {
$db = new PDO('sqlite:file:../not_in_open_basedir.sqlite');
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
try {
$db = new PDO('sqlite:file:../not_in_open_basedir.sqlite?mode=ro');
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECT--
open_basedir prohibits opening ../not_in_open_basedir.sqlite
open_basedir prohibits opening file:../not_in_open_basedir.sqlite
open_basedir prohibits opening file:../not_in_open_basedir.sqlite?mode=ro