$window_expired = -1;
$name = 'flood_test_cleanup';
- // Register expired event.
$flood = \Drupal::flood();
+ $this->assertTrue($flood->isAllowed($name, $threshold));
+ // Register expired event.
$flood->register($name, $window_expired);
// Verify event is not allowed.
$this->assertFalse($flood->isAllowed($name, $threshold));
$request_stack = \Drupal::service('request_stack');
$flood = new MemoryBackend($request_stack);
+ $this->assertTrue($flood->isAllowed($name, $threshold));
// Register expired event.
$flood->register($name, $window_expired);
// Verify event is not allowed.
$connection = \Drupal::service('database');
$request_stack = \Drupal::service('request_stack');
$flood = new DatabaseBackend($connection, $request_stack);
+ $this->assertTrue($flood->isAllowed($name, $threshold));
// Register expired event.
$flood->register($name, $window_expired);
// Verify event is not allowed.