mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
QA - pcntl - adjust tests set/get priority check env vars and root user
This commit is contained in:
parent
279a297172
commit
663b037c7b
@ -2,9 +2,12 @@
|
||||
pcntl_getpriority() - Wrong mode passed and also for non existing process id provided
|
||||
--EXTENSIONS--
|
||||
pcntl
|
||||
posix
|
||||
--SKIPIF--
|
||||
<?php
|
||||
|
||||
require_once("pcntl_skipif_user_env_rules.inc");
|
||||
|
||||
if (!function_exists('pcntl_getpriority')) {
|
||||
die('skip pcntl_getpriority doesn\'t exist');
|
||||
}
|
||||
|
@ -2,9 +2,12 @@
|
||||
pcntl_getpriority() - Wrong mode passed and also for non existing process id provided
|
||||
--EXTENSIONS--
|
||||
pcntl
|
||||
posix
|
||||
--SKIPIF--
|
||||
<?php
|
||||
|
||||
require_once("pcntl_skipif_user_env_rules.inc");
|
||||
|
||||
if (!function_exists('pcntl_getpriority')) {
|
||||
die('skip pcntl_getpriority doesn\'t exist');
|
||||
}
|
||||
|
@ -2,9 +2,12 @@
|
||||
pcntl_setpriority() - Check for errors
|
||||
--EXTENSIONS--
|
||||
pcntl
|
||||
posix
|
||||
--SKIPIF--
|
||||
<?php
|
||||
|
||||
require_once("pcntl_skipif_user_env_rules.inc");
|
||||
|
||||
if (!function_exists('pcntl_setpriority')) {
|
||||
die('skip pcntl_setpriority doesn\'t exist');
|
||||
}
|
||||
|
@ -2,9 +2,12 @@
|
||||
pcntl_setpriority() - Check for errors
|
||||
--EXTENSIONS--
|
||||
pcntl
|
||||
posix
|
||||
--SKIPIF--
|
||||
<?php
|
||||
|
||||
require_once("pcntl_skipif_user_env_rules.inc");
|
||||
|
||||
if (!function_exists('pcntl_setpriority')) {
|
||||
die('skip pcntl_setpriority doesn\'t exist');
|
||||
}
|
||||
|
@ -2,9 +2,12 @@
|
||||
pcntl_setpriority() - Check for errors
|
||||
--EXTENSIONS--
|
||||
pcntl
|
||||
posix
|
||||
--SKIPIF--
|
||||
<?php
|
||||
|
||||
require_once("pcntl_skipif_user_env_rules.inc");
|
||||
|
||||
if (!function_exists('pcntl_setpriority')) {
|
||||
die('skip pcntl_setpriority doesn\'t exist');
|
||||
}
|
||||
|
15
ext/pcntl/tests/pcntl_skipif_user_env_rules.inc
Normal file
15
ext/pcntl/tests/pcntl_skipif_user_env_rules.inc
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
$envUser = getenv("USER") ?: getenv("USERNAME");
|
||||
|
||||
if ($envUser === false) {
|
||||
die("skip This test is not executed without environment variables USER/USERNAME");
|
||||
}
|
||||
|
||||
if (function_exists("posix_geteuid")) {
|
||||
if (posix_geteuid() === 0) {
|
||||
die("skip This test is not executed with root user");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user