diff --git a/core/modules/system/src/Tests/System/FloodTest.php b/core/modules/system/src/Tests/System/FloodTest.php index a3a3368..bba3032 100644 --- a/core/modules/system/src/Tests/System/FloodTest.php +++ b/core/modules/system/src/Tests/System/FloodTest.php @@ -34,8 +34,9 @@ public function testCleanUp() { $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)); @@ -62,6 +63,7 @@ public function testMemoryBackend() { $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. @@ -90,6 +92,7 @@ public function testDatabaseBackend() { $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.