Tests: chdir() and open() for PHP module.

These tests ensure optimizations in the chdir calls don't break
SAPI semantics.
This commit is contained in:
Tiago Natel de Moura
2020-03-03 18:53:26 +00:00
parent 293b0da520
commit 80763b3e64
6 changed files with 161 additions and 6 deletions

19
test/php/cwd/index.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
if (isset($_GET['chdir']) && $_GET['chdir'] != "") {
if (!chdir($_GET['chdir'])) {
echo "failure to chdir(" . $_GET['chdir'] . ")\n";
exit;
}
}
$opcache = -1;
if (function_exists('opcache_get_status')) {
$opcache = opcache_get_status()->opcache_enabled;
}
header('X-OPcache: ' . $opcache);
print(getcwd());
?>

View File

@@ -0,0 +1 @@
<?php print(getcwd()); ?>