You are here

protected function StorageTestBase::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php \Drupal\KernelTests\Core\KeyValueStore\StorageTestBase::setUp()
  2. 9 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 33

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();
  }
}