function StorageTestBase::setUp

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php \Drupal\KernelTests\Core\KeyValueStore\StorageTestBase::setUp()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php \Drupal\KernelTests\Core\KeyValueStore\StorageTestBase::setUp()
  3. 11.x core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php \Drupal\KernelTests\Core\KeyValueStore\StorageTestBase::setUp()

Overrides KernelTestBase::setUp

2 calls to StorageTestBase::setUp()
DatabaseStorageExpirableTest::setUp in core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
DatabaseStorageTest::setUp in core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php
2 methods override StorageTestBase::setUp()
DatabaseStorageExpirableTest::setUp in core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
DatabaseStorageTest::setUp in core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php

File

core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php, line 38

Class

StorageTestBase
Base class for testing key-value storages.

Namespace

Drupal\KernelTests\Core\KeyValueStore

Code

protected function setUp() : void {
    parent::setUp();
    // Define two data collections,
    $this->collections = [
        0 => 'zero',
        1 => 'one',
    ];
    // Create several objects for testing.
    for ($i = 0; $i <= 5; $i++) {
        $this->objects[$i] = $this->randomObject();
    }
}

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