Annotation of embedaddon/php/ext/posix/tests/posix_seteuid_variation4.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test function posix_seteuid() by substituting argument 1 with float values.
                      3: --SKIPIF--
                      4: <?php 
                      5:         if(!extension_loaded("posix")) print "skip - POSIX extension not loaded"; 
                      6:         if(posix_geteuid() == 0) print "skip - Cannot run test as root.";
                      7: ?>
                      8: --CREDITS--
                      9: Marco Fabbri mrfabbri@gmail.com
                     10: Francesco Fullone ff@ideato.it
                     11: #PHPTestFest Cesena Italia on 2009-06-20
                     12: --FILE--
                     13: <?php
                     14: 
                     15: 
                     16: echo "*** Test substituting argument 1 with float values ***\n";
                     17: 
                     18: $myUid = posix_getuid();
                     19: 
                     20: $myUid = $myUid - 1.1;
                     21: 
                     22: $variation_array = array(
                     23:   'float '.$myUid => $myUid,
                     24:   'float -'.$myUid => -$myUid,
                     25:   'float 12.3456789000e10' => 12.3456789000e10,
                     26:   'float -12.3456789000e10' => -12.3456789000e10,
                     27:   'float .5' => .5,
                     28:   );
                     29: 
                     30: 
                     31: foreach ( $variation_array as $var ) {
                     32:   var_dump(posix_seteuid( $var  ) );
                     33: }
                     34: ?>
                     35: --EXPECTF--
                     36: *** Test substituting argument 1 with float values ***
                     37: bool(false)
                     38: bool(false)
                     39: bool(false)
                     40: bool(false)
                     41: bool(false)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>