Skip to content

Commit 663b037

Browse files
jcmdevnexen
jcm
authored andcommittedAug 9, 2022
QA - pcntl - adjust tests set/get priority check env vars and root user
1 parent 279a297 commit 663b037

6 files changed

+30
-0
lines changed
 

‎ext/pcntl/tests/pcntl_getpriority_error.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
pcntl_getpriority() - Wrong mode passed and also for non existing process id provided
33
--EXTENSIONS--
44
pcntl
5+
posix
56
--SKIPIF--
67
<?php
78

9+
require_once("pcntl_skipif_user_env_rules.inc");
10+
811
if (!function_exists('pcntl_getpriority')) {
912
die('skip pcntl_getpriority doesn\'t exist');
1013
}

‎ext/pcntl/tests/pcntl_getpriority_error_darwin.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
pcntl_getpriority() - Wrong mode passed and also for non existing process id provided
33
--EXTENSIONS--
44
pcntl
5+
posix
56
--SKIPIF--
67
<?php
78

9+
require_once("pcntl_skipif_user_env_rules.inc");
10+
811
if (!function_exists('pcntl_getpriority')) {
912
die('skip pcntl_getpriority doesn\'t exist');
1013
}

‎ext/pcntl/tests/pcntl_setpriority_error.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
pcntl_setpriority() - Check for errors
33
--EXTENSIONS--
44
pcntl
5+
posix
56
--SKIPIF--
67
<?php
78

9+
require_once("pcntl_skipif_user_env_rules.inc");
10+
811
if (!function_exists('pcntl_setpriority')) {
912
die('skip pcntl_setpriority doesn\'t exist');
1013
}

‎ext/pcntl/tests/pcntl_setpriority_error_darwin.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
pcntl_setpriority() - Check for errors
33
--EXTENSIONS--
44
pcntl
5+
posix
56
--SKIPIF--
67
<?php
78

9+
require_once("pcntl_skipif_user_env_rules.inc");
10+
811
if (!function_exists('pcntl_setpriority')) {
912
die('skip pcntl_setpriority doesn\'t exist');
1013
}

‎ext/pcntl/tests/pcntl_setpriority_error_linux.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
pcntl_setpriority() - Check for errors
33
--EXTENSIONS--
44
pcntl
5+
posix
56
--SKIPIF--
67
<?php
78

9+
require_once("pcntl_skipif_user_env_rules.inc");
10+
811
if (!function_exists('pcntl_setpriority')) {
912
die('skip pcntl_setpriority doesn\'t exist');
1013
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
$envUser = getenv("USER") ?: getenv("USERNAME");
4+
5+
if ($envUser === false) {
6+
die("skip This test is not executed without environment variables USER/USERNAME");
7+
}
8+
9+
if (function_exists("posix_geteuid")) {
10+
if (posix_geteuid() === 0) {
11+
die("skip This test is not executed with root user");
12+
}
13+
}
14+
15+
?>

0 commit comments

Comments
 (0)
Please sign in to comment.