Skip to content

Commit 2c90bea

Browse files
royopapetk
authored andcommitted
Create posix_getpwnam_basic_01.phpt
User Group: PHPSP #phptestfestbrasil
1 parent 4411cb6 commit 2c90bea

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--TEST--
2+
Test posix_getpwnam() function : basic functionality
3+
--CREDITS--
4+
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
5+
User Group: PHPSP #phptestfestbrasil
6+
--SKIPIF--
7+
<?php
8+
if (!extension_loaded('posix')) die('skip - POSIX extension not loaded');
9+
?>
10+
--FILE--
11+
<?php
12+
$uid = posix_geteuid();
13+
$user = posix_getpwuid($uid);
14+
print_r(posix_getpwnam($user['name']));
15+
?>
16+
===DONE====
17+
--EXPECTREGEX--
18+
Array
19+
\(
20+
\[name\] => [^\r\n]+
21+
\[passwd\] => [^\r\n]+
22+
\[uid\] => [0-9]+
23+
\[gid\] => [0-9]+
24+
\[gecos\] => [^\r\n]*
25+
\[dir\] => [^\r\n]+
26+
\[shell\] => [^\r\n]+
27+
\)
28+
===DONE====

0 commit comments

Comments
 (0)