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