File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
posix /
tests /
posix_getgrgid.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:00 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
Test posix_getgrgid().
--CREDITS--
Till Klampaeckel, till@php.net
TestFest Berlin 2009
--SKIPIF--
<?php
if (!extension_loaded('posix')) {
die('SKIP The posix extension is not loaded.');
}
?>
--FILE--
<?php
$grp = posix_getgrgid(0);
if (!isset($grp['name'])) {
die('Array index "name" does not exist.');
}
if (!isset($grp['passwd'])) {
die('Array index "passwd" does not exist.');
}
if (!isset($grp['members'])) {
die('Array index "members" does not exist.');
} elseif (!is_array($grp['members'])) {
die('Array index "members" must be an array.');
} else {
if (count($grp['members']) > 0) {
foreach ($grp['members'] as $idx => $username) {
if (!is_int($idx)) {
die('Index in members Array is not an int.');
}
if (!is_string($username)) {
die('Username in members Array is not of type string.');
}
}
}
}
if (!isset($grp['gid'])) {
die('Array index "gid" does not exist.');
}
var_dump($grp['gid']);
?>
===DONE===
--EXPECT--
int(0)
===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>