php-src/ext/posix/tests/posix_getgrnam_basic.phpt
Niels Dossche d5f0362e59 Fix GH-10202: posix_getgr(gid|nam)_basic.phpt fail
The issue was that passwd was empty for the issue reporter, but the test
expected passwd to be non-empty. An empty passwd can occur if there is
no (encrypted) group password set up.
2023-01-02 16:54:47 +00:00

29 lines
532 B
PHP

--TEST--
Test posix_getgrnam() function : basic functionality
--EXTENSIONS--
posix
--SKIPIF--
<?php
if (!posix_getgroups()) die('skip - groups unavailable (ci)');
?>
--FILE--
<?php
$groupid = posix_getgroups()[0];
$group = posix_getgrgid($groupid);
$groupinfo = posix_getgrnam($group["name"]);
var_dump($groupinfo);
$groupinfo = posix_getgrnam("");
var_dump($groupinfo);
?>
--EXPECTF--
array(4) {
["name"]=>
string(%d) "%s"
["passwd"]=>
string(%d) "%S"
["members"]=>
%a
["gid"]=>
int(%d)
}
bool(false)