function MemoryBackendTest::testMemoryBackendThreshold

Same name and namespace in other branches
  1. 10 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 99

Class

MemoryBackendTest
Tests the memory flood implementation.

Namespace

Drupal\Tests\Core\Flood

Code

public function testMemoryBackendThreshold() {
    $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.