/** * @param $size * @return string */ public static function createRandomKey($size) { if ($size instanceof self) { $size = $size->getMaxKeySize(); } return StringUtils::random($size, StringUtils::RANDOM_ALL); }
/** * @dataProvider randomDataProvider */ public function testRandom($format, $flags = StringUtils::RANDOM_ALNUM) { $str = StringUtils::random(100, $flags); $this->assertSame(100, strlen($str)); $this->assertRegExp($format, $str); }