You are here

class MockPhpStorage in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/src/PhpStorage/MockPhpStorage.php \Drupal\system\PhpStorage\MockPhpStorage
  2. 9 core/modules/system/src/PhpStorage/MockPhpStorage.php \Drupal\system\PhpStorage\MockPhpStorage

Mock PHP storage class used for testing.

Hierarchy

Expanded class hierarchy of MockPhpStorage

1 file declares its use of MockPhpStorage
PhpStorageFactoryTest.php in core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php

File

core/modules/system/src/PhpStorage/MockPhpStorage.php, line 8

Namespace

Drupal\system\PhpStorage
View source
class MockPhpStorage {

  /**
   * The storage configuration.
   *
   * @var array
   */
  protected $configuration;

  /**
   * Constructs a MockPhpStorage object.
   *
   * @param array $configuration
   *   The storage configuration.
   */
  public function __construct(array $configuration) {
    $this->configuration = $configuration;
  }

  /**
   * Gets the configuration data.
   */
  public function getConfiguration() {
    return $this->configuration;
  }

  /**
   * Gets a single configuration key.
   */
  public function getConfigurationValue($key) {
    return $this->configuration[$key] ?? NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MockPhpStorage::$configuration protected property The storage configuration.
MockPhpStorage::getConfiguration public function Gets the configuration data.
MockPhpStorage::getConfigurationValue public function Gets a single configuration key.
MockPhpStorage::__construct public function Constructs a MockPhpStorage object.