function MemoryBackendTest::testMemoryBackendThreshold

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Flood/MemoryBackendTest.php \Drupal\Tests\Core\Flood\MemoryBackendTest::testMemoryBackendThreshold()
  2. 11.x core/tests/Drupal/Tests/Core/Flood/MemoryBackendTest.php \Drupal\Tests\Core\Flood\MemoryBackendTest::testMemoryBackendThreshold()

Tests memory backend records events to the nearest microsecond.

File

core/tests/Drupal/Tests/Core/Flood/MemoryBackendTest.php, line 103

Class

MemoryBackendTest
Tests the memory flood implementation.

Namespace

Drupal\Tests\Core\Flood

Code

public function testMemoryBackendThreshold() : void {
    $this->flood
        ->register('new event');
    $this->assertTrue($this->flood
        ->isAllowed('new event', '2'));
    $this->flood
        ->register('new event');
    $this->assertFalse($this->flood
        ->isAllowed('new event', '2'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.