You are here

public static function BlockedIpsExpireTestCase::randomDatetimeInFuture in Blocked IPs Expire 7

Generates a random date in the future.

Note this function makes the assumption that getrandmax() will return a number sufficiently high that it will be after the current UNIX timestamp.

Return value

\DateTime A datetime object representing this random date.

File

tests/blocked_ips_expire.base.test, line 167
Contains \BlockedIpsExpireTestCase.

Class

BlockedIpsExpireTestCase
An object containing test functions common to all tests for this module.

Code

public static function randomDatetimeInFuture() {
  $current_datetime = time();
  $rand_max = getrandmax();
  return self::randomDatetime($current_datetime, $rand_max);
}