php-src/ext/posix/tests/posix_getpwnam_basic_01.phpt
Nikita Popov 33a149afba Remove posix_getlogin() check from posix_getpwnam() test
It doesn't make sense to pass false to posix_getpwnam(). I'm not
sure what exactly this is guarding against, but it won't work in
this form.
2019-04-10 14:43:52 +02:00

33 lines
696 B
PHP

--TEST--
Test posix_getpwnam() function : basic functionality
--CREDITS--
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
User Group: PHPSP #phptestfestbrasil
--SKIPIF--
<?php
if (!extension_loaded('posix')) die('skip - POSIX extension not loaded');
?>
--FILE--
<?php
$uid = posix_geteuid();
$user = posix_getpwuid($uid);
$username = $user['name'];
$info = posix_getpwnam($username);
print_r($info);
var_dump($username == $info['name']);
?>
===DONE====
--EXPECTREGEX--
Array
\(
\[name\] => [^\r\n]+
\[passwd\] => [^\r\n]+
\[uid\] => [0-9]+
\[gid\] => [0-9]+
\[gecos\] => [^\r\n]*
\[dir\] => [^\r\n]+
\[shell\] => [^\r\n]+
\)
bool\(true\)
===DONE====