function MemoryBackendTest::setUp

Same name in other branches
  1. 9 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 27

Class

MemoryBackendTest
Tests the memory flood implementation.

Namespace

Drupal\Tests\Core\Flood

Code

protected function setUp() : void {
    parent::setUp();
    $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.