randomString() public static method

Generate a random string of a given length and character set
public static randomString ( integer $length = 64, string $characters = self::PRINTABLE_ASCII ) : string
$length integer How many characters do you want?
$characters string Which characters to choose from
return string
Ejemplo n.º 1
0
 /**
  * @covers Util::randomString()
  */
 public function testRandomString()
 {
     $sample = [Util::randomString(), Util::randomString()];
     $this->assertNotSame($sample[0], $sample[1]);
 }