summaryrefslogtreecommitdiff
path: root/ext/posix
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-06-17 13:05:59 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-06-17 13:05:59 +0200
commitd584f92195658b153a3898edac766ef09edf72b6 (patch)
tree374e735385b20589175a2b3493537c220d058ab7 /ext/posix
parent6381b1ee823d5439ced6d348cce6d3b8d45faa28 (diff)
downloadphp-git-d584f92195658b153a3898edac766ef09edf72b6.tar.gz
Add debug output to posix_getlogin() test
Diffstat (limited to 'ext/posix')
-rw-r--r--ext/posix/tests/posix_getlogin_basic.phpt21
1 files changed, 9 insertions, 12 deletions
diff --git a/ext/posix/tests/posix_getlogin_basic.phpt b/ext/posix/tests/posix_getlogin_basic.phpt
index bef46e9db0..4dd1131779 100644
--- a/ext/posix/tests/posix_getlogin_basic.phpt
+++ b/ext/posix/tests/posix_getlogin_basic.phpt
@@ -7,25 +7,22 @@ Rogerio Prado de Jesus <rogeriopradoj@gmail.com>
Felipe Almeida <felipealmeida948@gmail.com>
Ariana Kataoka <ariskataoka@gmail.com>
Leonardo Gouveia <leogouv@gmail.com>
-User Groups: PHPVale
- PHPSP
- PHPDF
- PHP Women
-Hangout presented by #phptestfestbrasil on 2017-11-14
-https://www.youtube.com/watch?v=bBWkzZEadNo
+User Groups: PHPVale PHPSP PHPDF PHP Women
--SKIPIF--
<?php
if(!extension_loaded("posix")) die("skip - POSIX extension not loaded");
?>
--FILE--
<?php
-$username = posix_getpwuid(posix_geteuid())['name'];
+$getpwuid = posix_getpwuid(posix_geteuid())['name'];
+$getlogin = posix_getlogin();
-if (posix_getlogin() == false) {
- $username = false;
+if ($getlogin === false || $getlogin === $getpwuid) {
+ echo "Success";
+} else {
+ echo "posix_getpwuid(): " . $getpwuid . "\n";
+ echo "posix_getlogin(): " . $getlogin . "\n";
}
-
-var_dump($username == posix_getlogin());
?>
--EXPECT--
-bool(true)
+Success