class MockPhpStorage

Same name in other branches
  1. 8.9.x core/modules/system/src/PhpStorage/MockPhpStorage.php \Drupal\system\PhpStorage\MockPhpStorage
  2. 10 core/modules/system/src/PhpStorage/MockPhpStorage.php \Drupal\system\PhpStorage\MockPhpStorage
  3. 11.x 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

Title Sort descending Modifiers Object type Summary
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.

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