Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ext/pcntl/tests/pcntl_getpriority_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
3 changes: 3 additions & 0 deletions ext/pcntl/tests/pcntl_getpriority_error_darwin.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
3 changes: 3 additions & 0 deletions ext/pcntl/tests/pcntl_setpriority_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
3 changes: 3 additions & 0 deletions ext/pcntl/tests/pcntl_setpriority_error_darwin.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
3 changes: 3 additions & 0 deletions ext/pcntl/tests/pcntl_setpriority_error_linux.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
15 changes: 15 additions & 0 deletions ext/pcntl/tests/pcntl_skipif_user_env_rules.inc
Original file line number Diff line number Diff line change
@@ -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");
}
}

?>