Annotation of embedaddon/php/ext/standard/tests/general_functions/proc_nice_variation5.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Test function proc_nice() by substituting argument 1 with int values.
        !             3: --CREDITS--
        !             4: Italian PHP TestFest 2009 Cesena 19-20-21 june
        !             5: Fabio Fabbrucci (fabbrucci@grupporetina.com)
        !             6: Michele Orselli (mo@ideato.it)
        !             7: Simone Gentili (sensorario@gmail.com)
        !             8: --SKIPIF--
        !             9: <?php
        !            10:        if(!function_exists('proc_nice')) die("skip. proc_nice not available ");
        !            11:        if(posix_geteuid() == 0) print "skip - Cannot run test as root.";
        !            12: ?>
        !            13: --FILE--
        !            14: <?php
        !            15: 
        !            16: 
        !            17: echo "*** Test substituting argument 1 with int values ***\n";
        !            18: 
        !            19: 
        !            20: 
        !            21: $variation_array = array (
        !            22:     'int 0' => 0,
        !            23:     'int 1' => 1,
        !            24:     'int 12345' => 12345,
        !            25:     'int -12345' => -2345,
        !            26:     );
        !            27: 
        !            28: 
        !            29: foreach ( $variation_array as $var ) {
        !            30:   var_dump(proc_nice( $var  ) );
        !            31: }
        !            32: ?>
        !            33: --EXPECTF--
        !            34: *** Test substituting argument 1 with int values ***
        !            35: bool(true)
        !            36: bool(true)
        !            37: bool(true)
        !            38: 
        !            39: Warning: proc_nice(): Only a super user may attempt to increase the priority of a process in %s on line %d
        !            40: bool(false)

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