public function testRandBoolean() { for ($length = 1; $length < 512; $length++) { $rand = Rand::getBoolean(); $this->assertTrue(is_bool($rand)); } }
public function formRand() { $bytes = Rand::getBytes(32, true); $this->data->bytes = "Random bytes (in Base64): " . base64_encode($bytes); $boolean = Rand::getBoolean(); $this->data->boolean = "Random boolean: " . ($boolean ? 'true' : 'false'); $integer = Rand::getInteger(0, 1000); $this->data->integer = "Random integer in [0-1000]: " . $integer; $float = Rand::getFloat(); $this->data->float = "Random float in [0-1): " . $float; $string = Rand::getString(32, 'abcdefghijklmnopqrstuvwxyz', true); $this->data->string = "Random string in latin alphabet:" . $string; $this->render(); }