mirror of
https://github.com/php/php-src.git
synced 2026-04-03 22:22:18 +02:00
Merge branch 'PHP-7.4'
* PHP-7.4: Create posix_getpwnam_basic_01.phpt
This commit is contained in:
28
ext/posix/tests/posix_getpwnam_basic_01.phpt
Normal file
28
ext/posix/tests/posix_getpwnam_basic_01.phpt
Normal file
@@ -0,0 +1,28 @@
|
||||
--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);
|
||||
print_r(posix_getpwnam($user['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]+
|
||||
\)
|
||||
===DONE====
|
||||
Reference in New Issue
Block a user