--TEST-- proc_nice() basic behaviour --SKIPIF-- nul")) { die('skip wmic not available'); } ?> --FILE-- $l) { if (!$n || empty($l)) { continue; } $d = []; foreach ($m as $c) { $d[] = (int) substr($l, $c + 1, strpos($l, ' ', $c + 2) - ($c + 1)); } if ($d[0] === $pid) { return $d[1]; } } return false; } $p = [ /* '' => ['', ''] */ 'Idle' => [4, 10], 'Below normal' => [6, 5], 'Normal' => [8, 0], 'Above normal' => [10, -5], 'High priority' => [13, -10] ]; foreach ($p as $test => $data) { printf('Testing \'%s\' (%d): ', $test, $data[1]); proc_nice($data[1]); print (($wp = get_priority_from_wmic()) === $data[0] ? 'Passed' : 'Failed (' . $wp . ')') . PHP_EOL; } ?> --EXPECT-- Testing 'Idle' (10): Passed Testing 'Below normal' (5): Passed Testing 'Normal' (0): Passed Testing 'Above normal' (-5): Passed Testing 'High priority' (-10): Passed