Tests \Drupal\Component\Utility\Crypt::randomBytes().
public function testRandomBytes() {
for ($i = 1; $i < 10; $i++) {
$count = rand(10, 10000);
// Check that different values are being generated.
$this
->assertNotEquals(Crypt::randomBytes($count), Crypt::randomBytes($count));
// Check the length.
$this
->assertEquals(strlen(Crypt::randomBytes($count)), $count);
}
}