1--TEST-- 2Maths test for xapic versions of lcg_value() 3--FILE-- 4<?php 5 6echo "MATHS test script started\n"; 7 8 9echo "\n lcg_value tests...\n"; 10for ($i = 0; $i < 100; $i++) { 11 $res = lcg_value(); 12 13 if (!is_float($res) || $res < 0 || $res > 1) { 14 break; 15 } 16} 17 18if ($i != 100) { 19 echo "FAILED\n"; 20} else { 21 echo "PASSED\n"; 22} 23 24echo "\n lcg_value error cases..\n"; 25$res = lcg_value(23); 26 27if (is_null($res)) { 28 echo "PASSED\n"; 29} else { 30 echo "FAILED\n"; 31} 32 33$res = lcg_value(10,false); 34if (is_null($res)) { 35 echo "PASSED\n"; 36} else { 37 echo "FAILED\n"; 38} 39 40echo "MATHS test script completed\n"; 41 42?> 43--EXPECTF-- 44MATHS test script started 45 46 lcg_value tests... 47PASSED 48 49 lcg_value error cases.. 50 51Warning: lcg_value() expects exactly 0 parameters, 1 given in %slcg_value_basic.php on line %d 52PASSED 53 54Warning: lcg_value() expects exactly 0 parameters, 2 given in %slcg_value_basic.php on line %d 55PASSED 56MATHS test script completed 57