1--TEST--
2Test function posix_setgid() by substituting argument 1 with emptyUnsetUndefNull values.
3--CREDITS--
4Marco Fabbri mrfabbri@gmail.com
5Francesco Fullone ff@ideato.it
6#PHPTestFest Cesena Italia on 2009-06-20
7--SKIPIF--
8<?php
9        if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
10        if(posix_geteuid() == 0) print "skip - Cannot run test as root.";
11?>
12--FILE--
13<?php
14
15
16echo "*** Test substituting argument 1 with emptyUnsetUndefNull values ***\n";
17
18
19
20$unset_var = 10;
21unset($unset_var);
22
23$variation_array = array(
24  'unset var' => @$unset_var,
25  'undefined var' => @$undefined_var,
26  'empty string DQ' => "",
27  'empty string SQ' => '',
28  'uppercase NULL' => NULL,
29  'lowercase null' => null,
30  );
31
32
33foreach ( $variation_array as $var ) {
34  var_dump(posix_setgid( $var  ) );
35}
36?>
37--EXPECTF--
38*** Test substituting argument 1 with emptyUnsetUndefNull values ***
39bool(false)
40bool(false)
41
42Warning: posix_setgid() expects parameter 1 to be int, string given in %s on line %d
43bool(false)
44
45Warning: posix_setgid() expects parameter 1 to be int, string given in %s on line %d
46bool(false)
47bool(false)
48bool(false)
49