function MemoryBackendTest::setUp

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/Flood/MemoryBackendTest.php \Drupal\Tests\Core\Flood\MemoryBackendTest::setUp()
  2. 11.x core/tests/Drupal/Tests/Core/Flood/MemoryBackendTest.php \Drupal\Tests\Core\Flood\MemoryBackendTest::setUp()

Overrides UnitTestCase::setUp

File

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

Class

MemoryBackendTest
Tests the memory flood implementation.

Namespace

Drupal\Tests\Core\Flood

Code

protected function setUp() : void {
    $request = new RequestStack();
    $request_mock = $this->getMockBuilder(Request::class)
        ->onlyMethods([
        'getClientIp',
    ])
        ->getMock();
    $request->push($request_mock);
    $this->flood = new MemoryBackend($request);
}

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