--TEST-- Random: Randomizer: getBytesFromString(): Basic functionality --FILE-- getBytesFromString('a', 10)); var_dump($randomizer->getBytesFromString(str_repeat('a', 256), 5)); for ($i = 1; $i < 250; $i++) { $output = $randomizer->getBytesFromString(str_repeat('ab', $i), 500); // This check can theoretically fail with a chance of 0.5**500. if (!str_contains($output, 'a') || !str_contains($output, 'b')) { die("failure: didn't see both a and b at {$i}"); } } } die('success'); ?> --EXPECTF-- Deprecated: Constant MT_RAND_PHP is deprecated in %s on line %d Deprecated: The MT_RAND_PHP variant of Mt19937 is deprecated in %s on line %d Random\Engine\Mt19937 string(10) "aaaaaaaaaa" string(5) "aaaaa" Random\Engine\Mt19937 string(10) "aaaaaaaaaa" string(5) "aaaaa" Random\Engine\PcgOneseq128XslRr64 string(10) "aaaaaaaaaa" string(5) "aaaaa" Random\Engine\Xoshiro256StarStar string(10) "aaaaaaaaaa" string(5) "aaaaa" Random\Engine\Secure string(10) "aaaaaaaaaa" string(5) "aaaaa" Random\Engine\Test\TestShaEngine string(10) "aaaaaaaaaa" string(5) "aaaaa" success