class TestStorage

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php \Drupal\Tests\Core\Config\TestStorage
  2. 8.9.x core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php \Drupal\Tests\Core\Config\TestStorage
  3. 10 core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php \Drupal\Tests\Core\Config\TestStorage

Provides a test implementation of \Drupal\Core\Config\StorageInterface.

Hierarchy

Expanded class hierarchy of TestStorage

File

core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php, line 174

Namespace

Drupal\Tests\Core\Config
View source
class TestStorage extends MemoryStorage {
    
    /**
     * Provides a setter to bypass the array type hint on ::write().
     *
     * This method allows us to create invalid configurations. The method
     * ::write() only allows values of the type array.
     */
    public function setValue($name, $value) : void {
        $this->config[$this->collection][$name] = $value;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
MemoryStorage::$collection protected property The storage collection.
MemoryStorage::$config protected property The configuration, an object shared by reference across collections.
MemoryStorage::createCollection public function Overrides StorageInterface::createCollection
MemoryStorage::decode public function Overrides StorageInterface::decode
MemoryStorage::delete public function Overrides StorageInterface::delete
MemoryStorage::deleteAll public function Overrides StorageInterface::deleteAll
MemoryStorage::encode public function Overrides StorageInterface::encode
MemoryStorage::exists public function Overrides StorageInterface::exists
MemoryStorage::getAllCollectionNames public function Overrides StorageInterface::getAllCollectionNames
MemoryStorage::getCollectionName public function Overrides StorageInterface::getCollectionName
MemoryStorage::listAll public function Overrides StorageInterface::listAll
MemoryStorage::read public function Overrides StorageInterface::read
MemoryStorage::readMultiple public function Overrides StorageInterface::readMultiple
MemoryStorage::rename public function Overrides StorageInterface::rename
MemoryStorage::write public function Overrides StorageInterface::write
MemoryStorage::__construct public function Constructs a new MemoryStorage.
StorageInterface::DEFAULT_COLLECTION constant The default collection name.
TestStorage::setValue public function Provides a setter to bypass the array type hint on ::write().

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